Skip to content

Commit

Permalink
Merge pull request #1298 from kube-logging/syslog-ng-persist-file-escape
Browse files Browse the repository at this point in the history
chore(fix): syslog-ng persist file argument escaping
  • Loading branch information
pepov authored Apr 12, 2023
2 parents e0331c4 + c8363c8 commit f2079b2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/resources/syslogng/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ func (r *Reconciler) statefulset() (runtime.Object, reconciler.DesiredState, err
syslogngContainer := kubetool.FindContainerByName(desired.Spec.Template.Spec.Containers, containerName)
if mnt := kubetool.FindVolumeMountByName(syslogngContainer.VolumeMounts, buffersVolumeName); mnt != nil {
if !sliceAny(syslogngContainer.Args, func(arg string) bool { return strings.Contains(arg, "--persist-file") }) {
persistFilePath := filepath.Join(mnt.MountPath, "/syslog-ng.persist")
persistFileFlag := fmt.Sprintf("--persist-file=%q", persistFilePath)
syslogngContainer.Args = append(syslogngContainer.Args, persistFileFlag)
syslogngContainer.Args = append(syslogngContainer.Args,
"--persist-file", filepath.Join(mnt.MountPath, "/syslog-ng.persist"))
}
}

Expand Down

0 comments on commit f2079b2

Please sign in to comment.