@@ -36,6 +36,12 @@ type AxoSyslogSpec struct {
3636 // LogPaths is a list of log paths to be rendered in the AxoSyslog configuration
3737 LogPaths []LogPath `json:"logPaths,omitempty"`
3838
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+
3945 // Destinations is a list of destinations to be rendered in the AxoSyslog configuration
4046 Destinations []Destination `json:"destinations,omitempty"`
4147}
@@ -92,11 +98,33 @@ func init() {
9298}
9399
94100func (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+ }
100128 }
101129
102130 return nil
0 commit comments