mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
allow missing properties field
This commit is contained in:
committed by
Aiden McClelland
parent
19d1e905a2
commit
d157b7871b
@@ -29,18 +29,21 @@ pub async fn fetch_properties(ctx: RpcContext, id: PackageId) -> Result<Value, E
|
||||
.get(&mut db, true)
|
||||
.await?
|
||||
.to_owned();
|
||||
manifest
|
||||
.properties
|
||||
.execute::<(), Value>(
|
||||
&ctx,
|
||||
&manifest.id,
|
||||
&manifest.version,
|
||||
None,
|
||||
&manifest.volumes,
|
||||
None,
|
||||
false,
|
||||
)
|
||||
.await?
|
||||
.map_err(|_| Error::new(anyhow!("Properties failure!"), crate::ErrorKind::Docker))
|
||||
.and_then(|a| Ok(a))
|
||||
if let Some(props) = manifest.properties {
|
||||
props
|
||||
.execute::<(), Value>(
|
||||
&ctx,
|
||||
&manifest.id,
|
||||
&manifest.version,
|
||||
None,
|
||||
&manifest.volumes,
|
||||
None,
|
||||
false,
|
||||
)
|
||||
.await?
|
||||
.map_err(|_| Error::new(anyhow!("Properties failure!"), crate::ErrorKind::Docker))
|
||||
.and_then(|a| Ok(a))
|
||||
} else {
|
||||
Ok(Value::Null)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ pub struct Manifest {
|
||||
#[model]
|
||||
pub config: Option<ConfigActions>,
|
||||
#[model]
|
||||
pub properties: ActionImplementation,
|
||||
pub properties: Option<ActionImplementation>,
|
||||
#[model]
|
||||
pub volumes: Volumes,
|
||||
// #[serde(default = "current_version")]
|
||||
|
||||
Reference in New Issue
Block a user