Global defaults for image configs

Allows setting of image configs at a global level to act as default
values.

This required a change in the model.Image struct due to a bool field not
having a third, unset state. The remedy is to unmarshal into a temporary
data structure to detect the presents of a field value and then use that
to determine if the default value should be used.

Fixes #491
This commit is contained in:
Ian Fijolek
2023-01-23 16:38:43 -08:00
parent 052a472d0b
commit 60ddac4a59
20 changed files with 1010 additions and 71 deletions

View File

@@ -101,7 +101,7 @@ func (c *Client) listTaskImages() []model.Image {
c.logger.Error().Err(err).Msg("Cannot merge task metadata")
}
image, err := provider.ValidateImage(imageName, metadata(job, taskGroup, task), labels, *c.config.WatchByDefault)
image, err := provider.ValidateImage(imageName, metadata(job, taskGroup, task), labels, *c.config.WatchByDefault, *c.imageDefaults)
if err != nil {
c.logger.Error().
Err(err).