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