Skip to content

Commit

Permalink
Merge pull request #1195 from sarathchandra24/fix-path-issues
Browse files Browse the repository at this point in the history
Fix fluentd path issues.
  • Loading branch information
benjaminhuo authored Jun 5, 2024
2 parents d1a2e27 + 36aa0e6 commit 2de2b93
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cmd/fluent-watcher/fluentd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"math"
"os"
"os/exec"
"runtime"
"sync"
"sync/atomic"
"syscall"
Expand All @@ -19,7 +20,8 @@ import (
)

const (
defaultBinPath = "/usr/local/bundle/bin/fluentd"
defaultBinPath = "/usr/bin/fluentd"
defaultArm64BinPath = "/usr/local/bundle/bin/fluentd"
defaultCfgPath = "/fluentd/etc/fluent.conf"
defaultWatchDir = "/fluentd/etc"
defaultPluginPath = "/fluentd/plugins"
Expand Down Expand Up @@ -48,7 +50,16 @@ var pollInterval time.Duration

func main() {

flag.StringVar(&binPath, "b", defaultBinPath, "The fluentd binary path.")
logger = log.NewLogfmtLogger(os.Stdout)

_ = level.Info(logger).Log("msg", "Current architecture", "arch", runtime.GOARCH)

switch runtime.GOARCH {
case "arm64":
flag.StringVar(&binPath, "b", defaultArm64BinPath, "The fluentd binary path for arm64.")
default:
flag.StringVar(&binPath, "b", defaultBinPath, "The fluentd binary path for amd64.")
}
flag.StringVar(&configPath, "c", defaultCfgPath, "The config file path.")
flag.StringVar(&pluginPath, "p", defaultPluginPath, "The config file path.")
flag.BoolVar(&exitOnFailure, "exit-on-failure", false, "If fluentd exits with failure, also exit the watcher.")
Expand Down

0 comments on commit 2de2b93

Please sign in to comment.