fix: Use global defaults in File provider

The `file` provider was not considering the global defaults for
`MaxTags`, `IncludeTags`, and `ExcludeTags`.

Updated unit tests to validate they are now considered.
This commit is contained in:
Michael Manganiello
2023-12-24 16:48:41 -03:00
parent ae1e3e09e6
commit 29200f170d
3 changed files with 104 additions and 0 deletions

View File

@@ -80,6 +80,21 @@ func (c *Client) listFileImage() []model.Image {
}
}
// Set default MaxTags
if item.MaxTags == 0 {
item.MaxTags = c.defaults.MaxTags
}
// Set default IncludeTags
if len(item.IncludeTags) == 0 {
item.IncludeTags = c.defaults.IncludeTags
}
// Set default ExcludeTags
if len(item.ExcludeTags) == 0 {
item.ExcludeTags = c.defaults.ExcludeTags
}
images = append(images, item)
}
}