Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beats: import time/tzdata explicitly in main #40420

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
beats: import time/tzdata explicitly in main
In order to handle timezones we import Go's own timezone database. This
import is done indirectly by libbeat/common/cfgtype. We trust that this
package will end up being required by the dependency chain of every beats
main binary.

To ensure that the binaries continue to handle timezones correctly and to
avoid any unexpected issues, let's import time/tzdata explicitly in the
main packages.

See #40326.
mauri870 committed Aug 1, 2024
commit 5459933ce464e8ab55aca3fa482b17bb46104610
1 change: 1 addition & 0 deletions auditbeat/main.go
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ package main

import (
"os"
_ "time/tzdata" // for timezone handling

"github.com/elastic/beats/v7/auditbeat/cmd"
)
1 change: 1 addition & 0 deletions filebeat/main.go
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ package main

import (
"os"
_ "time/tzdata" // for timezone handling

"github.com/elastic/beats/v7/filebeat/cmd"
inputs "github.com/elastic/beats/v7/filebeat/input/default-inputs"
1 change: 1 addition & 0 deletions heartbeat/main.go
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ package main

import (
"os"
_ "time/tzdata" // for timezone handling

"github.com/elastic/beats/v7/heartbeat/cmd"

1 change: 1 addition & 0 deletions metricbeat/main.go
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ package main

import (
"os"
_ "time/tzdata" // for timezone handling

"github.com/elastic/beats/v7/metricbeat/cmd"
)
1 change: 1 addition & 0 deletions packetbeat/main.go
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ package main

import (
"os"
_ "time/tzdata" // for timezone handling

"github.com/elastic/beats/v7/packetbeat/cmd"
)
1 change: 1 addition & 0 deletions winlogbeat/main.go
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ package main

import (
"os"
_ "time/tzdata" // for timezone handling

"github.com/elastic/beats/v7/winlogbeat/cmd"
)
1 change: 1 addition & 0 deletions x-pack/agentbeat/main.go
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ package main
import (
"fmt"
"os"
_ "time/tzdata" // for timezone handling

"github.com/elastic/beats/v7/libbeat/cfgfile"
"github.com/elastic/beats/v7/libbeat/cmd"
1 change: 1 addition & 0 deletions x-pack/auditbeat/main.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ package main

import (
"os"
_ "time/tzdata" // for timezone handling

"github.com/elastic/beats/v7/x-pack/auditbeat/cmd"
)
1 change: 1 addition & 0 deletions x-pack/dockerlogbeat/main.go
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ import (
"fmt"
"os"
"strconv"
_ "time/tzdata" // for timezone handling

"github.com/docker/go-plugins-helpers/sdk"

1 change: 1 addition & 0 deletions x-pack/filebeat/main.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ package main

import (
"os"
_ "time/tzdata" // for timezone handling

"github.com/elastic/beats/v7/x-pack/filebeat/cmd"
)
1 change: 1 addition & 0 deletions x-pack/functionbeat/main.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ package main

import (
"os"
_ "time/tzdata" // for timezone handling

_ "github.com/elastic/beats/v7/x-pack/functionbeat/include" // imports features
"github.com/elastic/beats/v7/x-pack/functionbeat/manager/cmd"
1 change: 1 addition & 0 deletions x-pack/heartbeat/main.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ package main

import (
"os"
_ "time/tzdata" // for timezone handling

"github.com/elastic/beats/v7/x-pack/heartbeat/cmd"
)
1 change: 1 addition & 0 deletions x-pack/metricbeat/main.go
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ package main

import (
"os"
_ "time/tzdata" // for timezone handling

"github.com/elastic/beats/v7/x-pack/metricbeat/cmd"
)
1 change: 1 addition & 0 deletions x-pack/osquerybeat/main.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ package main

import (
"os"
_ "time/tzdata" // for timezone handling

"github.com/elastic/beats/v7/x-pack/osquerybeat/cmd"
)
1 change: 1 addition & 0 deletions x-pack/packetbeat/main.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ package main

import (
"os"
_ "time/tzdata" // for timezone handling

"github.com/elastic/beats/v7/x-pack/packetbeat/cmd"
)
1 change: 1 addition & 0 deletions x-pack/winlogbeat/main.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ package main

import (
"os"
_ "time/tzdata" // for timezone handling

"github.com/elastic/beats/v7/x-pack/winlogbeat/cmd"
)