Skip to content

Commit

Permalink
fix(update-collection-v3): fix migration of configuration with missin…
Browse files Browse the repository at this point in the history
…g sumologic key

 and additional configuration under fluentd.logs key
  • Loading branch information
kkujawa-sumo committed Jan 12, 2023
1 parent b040a9e commit 12f2973
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ func createSumologic(valuesInput *ValuesInput) *SumologicOutput {

sumoLogicOutput := &SumologicOutput{}
if valuesInput.Fluentd != nil {
sumoLogicOutput.Logs = createSumologicLogs(valuesInput.Fluentd.Logs, valuesInput.Sumologic.Logs)
var valuesInputSumologicLogs *SumologicLogsInput
if valuesInput.Sumologic != nil {
valuesInputSumologicLogs = valuesInput.Sumologic.Logs
}
sumoLogicOutput.Logs = createSumologicLogs(valuesInput.Fluentd.Logs, valuesInputSumologicLogs)
}

if valuesInput.Sumologic != nil {
Expand Down Expand Up @@ -130,7 +134,8 @@ func isFluentdOutputEmpty(fluentdInput *Fluentd) bool {
isContainersLogRestEmpty(fluentdInput.Logs.Containers) &&
isLogRestEmpty(fluentdInput.Logs.Systemd) &&
isLogRestEmpty(fluentdInput.Logs.Kubelet) &&
isLogRestEmpty(fluentdInput.Logs.Default)) {
isLogRestEmpty(fluentdInput.Logs.Default)) &&
fluentdInput.Logs.Rest == nil {
return true
}
return false
Expand Down Expand Up @@ -170,6 +175,7 @@ func createFluentdLogs(valuesInput *ValuesInput) *Fluentd {
Systemd: createFluentdLogsConfig(valuesInput.Fluentd.Logs.Systemd),
Kubelet: createFluentdLogsConfig(valuesInput.Fluentd.Logs.Kubelet),
Default: createFluentdLogsConfig(valuesInput.Fluentd.Logs.Default),
Rest: valuesInput.Fluentd.Logs.Rest,
},
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fluentd:
logs:
autoscaling:
enabled: true
maxReplicas: 10
minReplicas: 3
targetCPUUtilizationPercentage: 50
containers:
sourceCategoryReplaceDash: _
kubelet:
sourceCategoryReplaceDash: _
systemd:
sourceCategoryReplaceDash: _
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
sumologic:
logs:
container:
sourceCategoryReplaceDash: _
systemd:
sourceCategoryReplaceDash: _
kubelet:
sourceCategoryReplaceDash: _
fluentd:
logs:
autoscaling:
enabled: true
maxReplicas: 10
minReplicas: 3
targetCPUUtilizationPercentage: 50

0 comments on commit 12f2973

Please sign in to comment.