Skip to content

Commit 4b0d848

Browse files
committed
refactor: rename default image and tag
Signed-off-by: Bence Csati <[email protected]>
1 parent 6b68521 commit 4b0d848

File tree

2 files changed

+37
-9
lines changed

2 files changed

+37
-9
lines changed

pkg/sdk/logging/api/v1beta1/axosyslog_types.go

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

94100
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+
}
100128
}
101129

102130
return nil

pkg/sdk/logging/api/v1beta1/syslogng_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ type _hugoSyslogNGSpec interface{} //nolint:deadcode,unused
3333
type _metaSyslogNGSpec interface{} //nolint:deadcode,unused
3434

3535
const (
36-
defaultSyslogngImageRepository = "ghcr.io/axoflow/axosyslog"
37-
defaultSyslogngImageTag = "4.11.0"
36+
defaultAxoSyslogImageRepository = "ghcr.io/axoflow/axosyslog"
37+
defaultAxoSyslogImageTag = "4.11.0"
3838
defaultPrometheusExporterImageRepository = "ghcr.io/axoflow/axosyslog-metrics-exporter"
3939
defaultPrometheusExporterImageTag = "0.0.9"
4040
defaultConfigReloaderImageRepository = "ghcr.io/kube-logging/logging-operator/syslog-ng-reloader"
@@ -144,8 +144,8 @@ func (s *SyslogNGSpec) SetDefaults() {
144144
}
145145
if s.SyslogNGImage == nil {
146146
s.SyslogNGImage = &BasicImageSpec{
147-
Repository: defaultSyslogngImageRepository,
148-
Tag: defaultSyslogngImageTag,
147+
Repository: defaultAxoSyslogImageRepository,
148+
Tag: defaultAxoSyslogImageTag,
149149
}
150150
}
151151
if s.ConfigReloadImage == nil {

0 commit comments

Comments
 (0)