@@ -36,6 +36,12 @@ type AxoSyslogSpec struct {
36
36
// LogPaths is a list of log paths to be rendered in the AxoSyslog configuration
37
37
LogPaths []LogPath `json:"logPaths,omitempty"`
38
38
39
+ // Image is the image specification for AxoSyslog
40
+ Image * BasicImageSpec `json:"image,omitempty"`
41
+
42
+ // ConfigReloadImage is the image specification for the config reload
43
+ ConfigReloadImage * BasicImageSpec `json:"configReloadImage,omitempty"`
44
+
39
45
// Destinations is a list of destinations to be rendered in the AxoSyslog configuration
40
46
Destinations []Destination `json:"destinations,omitempty"`
41
47
}
@@ -92,11 +98,33 @@ func init() {
92
98
}
93
99
94
100
func (a * AxoSyslog ) SetDefaults () error {
95
- if a .Spec .LogPaths == nil {
96
- a .Spec .LogPaths = []LogPath {}
97
- }
98
- if a .Spec .Destinations == nil {
99
- a .Spec .Destinations = []Destination {}
101
+ if a != nil {
102
+ if a .Spec .LogPaths == nil {
103
+ a .Spec .LogPaths = []LogPath {}
104
+ }
105
+ if a .Spec .Destinations == nil {
106
+ a .Spec .Destinations = []Destination {}
107
+ }
108
+
109
+ if a .Spec .Image == nil {
110
+ a .Spec .Image = & BasicImageSpec {
111
+ Repository : defaultAxoSyslogImageRepository ,
112
+ Tag : defaultAxoSyslogImageTag ,
113
+ }
114
+ }
115
+ if a .Spec .ConfigReloadImage == nil {
116
+ a .Spec .ConfigReloadImage = & BasicImageSpec {}
117
+ }
118
+ if a .Spec .ConfigReloadImage .Repository == "" {
119
+ a .Spec .ConfigReloadImage .Repository = defaultConfigReloaderImageRepository
120
+ }
121
+ if a .Spec .ConfigReloadImage .Tag == "" {
122
+ if Version == "" {
123
+ a .Spec .ConfigReloadImage .Tag = defaultConfigReloaderImageTag
124
+ } else {
125
+ a .Spec .ConfigReloadImage .Tag = Version
126
+ }
127
+ }
100
128
}
101
129
102
130
return nil
0 commit comments