mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-27 07:31:37 +01:00
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:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/crazy-max/diun/v4/internal/config"
|
||||
"github.com/crazy-max/diun/v4/internal/model"
|
||||
"github.com/crazy-max/diun/v4/pkg/registry"
|
||||
"github.com/crazy-max/diun/v4/pkg/utl"
|
||||
"github.com/crazy-max/gonfig/env"
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -58,6 +59,10 @@ func TestLoadFile(t *testing.T) {
|
||||
BaseURL: "https://hc-ping.com/",
|
||||
UUID: "5bf66975-d4c7-4bf5-bcc8-b8d8a82ea278",
|
||||
},
|
||||
ImageDefaults: &model.Image{
|
||||
NotifyOn: model.NotifyOnDefaults,
|
||||
SortTags: registry.SortTagReverse,
|
||||
},
|
||||
},
|
||||
Notif: &model.Notif{
|
||||
Amqp: &model.NotifAmqp{
|
||||
|
||||
Reference in New Issue
Block a user