Skip to content

Commit f886601

Browse files
committed
fix: check extra references specified in config
Fixes #81
1 parent 806364f commit f886601

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/check.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,29 @@ async fn get_remote_updates(ctx: &Context, client: &Client, refresh: bool) -> Ve
8181

8282
/// Returns a list of updates for all images passed in.
8383
pub async fn get_updates(
84-
references: &Option<Vec<String>>,
84+
references: &Option<Vec<String>>, // If a user requested _specific_ references to be checked, this will have a value
8585
refresh: bool,
8686
ctx: &Context,
8787
) -> Vec<Update> {
8888
let client = Client::new(ctx);
8989

90+
// Merge references argument with references from config
91+
let all_references = match &references {
92+
Some(refs) => {
93+
refs.clone().extend_from_slice(&ctx.config.images.extra);
94+
refs
95+
}
96+
None => &ctx.config.images.extra,
97+
};
98+
9099
// Get local images
91100
ctx.logger.debug("Retrieving images to be checked");
92101
let mut images = get_images_from_docker_daemon(ctx, references).await;
93102

94103
// Add extra images from references
95-
if let Some(refs) = references {
104+
if !all_references.is_empty() {
96105
let image_refs: FxHashSet<&String> = images.iter().map(|image| &image.reference).collect();
97-
let extra = refs
106+
let extra = all_references
98107
.iter()
99108
.filter(|&reference| !image_refs.contains(reference))
100109
.map(|reference| Image::from_reference(reference))

0 commit comments

Comments
 (0)