mirror of
https://github.com/crazy-max/diun.git
synced 2026-01-04 03:55:00 +01:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user