mirror of
https://github.com/moghtech/komodo.git
synced 2026-09-04 19:04:50 -05:00
add deployment filtering by build id
This commit is contained in:
@@ -317,6 +317,9 @@ pub type DeploymentQuery = ResourceQuery<DeploymentQuerySpecifics>;
|
||||
pub struct DeploymentQuerySpecifics {
|
||||
#[serde(default)]
|
||||
pub server_ids: Vec<String>,
|
||||
|
||||
#[serde(default)]
|
||||
pub build_ids: Vec<String>,
|
||||
}
|
||||
|
||||
impl AddFilters for DeploymentQuerySpecifics {
|
||||
@@ -325,5 +328,12 @@ impl AddFilters for DeploymentQuerySpecifics {
|
||||
filters
|
||||
.insert("config.server_id", doc! { "$in": &self.server_ids });
|
||||
}
|
||||
if !self.build_ids.is_empty() {
|
||||
filters.insert("config.image.type", "Build");
|
||||
filters.insert(
|
||||
"config.image.params.build_id",
|
||||
doc! { "$in": &self.build_ids },
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -768,6 +768,7 @@ export type _PartialDeploymentConfig = Partial<DeploymentConfig>;
|
||||
|
||||
export interface DeploymentQuerySpecifics {
|
||||
server_ids?: string[];
|
||||
build_ids?: string[];
|
||||
}
|
||||
|
||||
export type DeploymentQuery = ResourceQuery<DeploymentQuerySpecifics>;
|
||||
|
||||
Reference in New Issue
Block a user