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

Revert "add flag.Parse so HandlFlags works correctly (#14214)" #14292

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Changes from all commits
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
1 change: 0 additions & 1 deletion cmd/apm-server/main.go
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@ import (
)

func main() {
beatcmd.InitBeatCmd()
rootCmd := beatcmd.NewRootCommand(beatcmd.BeatParams{
NewRunner: func(args beatcmd.RunnerParams) (beatcmd.Runner, error) {
return beater.NewRunner(beater.RunnerParams{
4 changes: 1 addition & 3 deletions internal/beatcmd/init.go
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@ package beatcmd

import (
cryptorand "crypto/rand"
"flag"
"log"
"math"
"math/big"
@@ -39,7 +38,7 @@ import (
_ "github.com/elastic/beats/v7/libbeat/publisher/queue/memqueue"
)

func InitBeatCmd() {
func init() {
initRand()
initFlags()
}
@@ -63,7 +62,6 @@ func initFlags() {
}
}

flag.Parse()
if err := cfgfile.HandleFlags(); err != nil {
log.Fatal(err)
}
1 change: 0 additions & 1 deletion x-pack/apm-server/main.go
Original file line number Diff line number Diff line change
@@ -275,7 +275,6 @@ func cleanup() error {
}

func Main() error {
beatcmd.InitBeatCmd()
rootCmd := newXPackRootCommand(
func(args beatcmd.RunnerParams) (beatcmd.Runner, error) {
return beater.NewRunner(beater.RunnerParams{
1 change: 0 additions & 1 deletion x-pack/apm-server/root_test.go
Original file line number Diff line number Diff line change
@@ -13,7 +13,6 @@ import (
)

func TestSubCommands(t *testing.T) {
beatcmd.InitBeatCmd()
rootCmd := newXPackRootCommand(func(beatcmd.RunnerParams) (beatcmd.Runner, error) {
panic("unexpected call")
})