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

fix bug in 7.6.0 where unconfigured aerolab would crash if run withou… #357

Merged
merged 1 commit into from
Jul 12, 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
6 changes: 3 additions & 3 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ func (a *aerolab) main(args []string) error {
a.parseArgs(args)
a.early = false
_, err := a.parseFile()
if err != nil && os.Args[1] != "webui" && os.Args[1] != "upgrade" {
if err != nil && (len(os.Args) < 2 || (os.Args[1] != "webui" && os.Args[1] != "upgrade")) {
_, fna := path.Split(os.Args[0])
fmt.Printf(chooseBackendHelpMsg, fna, fna, fna)
os.Exit(1)
}
if !a.forceFileOptional && a.opts.Config.Backend.Type == "" && os.Args[1] != "webui" && os.Args[1] != "webrun" && os.Args[1] != "upgrade" {
if !a.forceFileOptional && a.opts.Config.Backend.Type == "" && (len(os.Args) < 2 || (os.Args[1] != "webui" && os.Args[1] != "webrun" && os.Args[1] != "upgrade")) {
_, fna := path.Split(os.Args[0])
fmt.Printf(chooseBackendHelpMsg, fna, fna, fna)
os.Exit(1)
Expand Down Expand Up @@ -398,7 +398,7 @@ func (a *aerolab) telemetry(webuiData string) error {
return nil
}
// do not ship config defaults command usage
if (os.Args[1] == "config" && os.Args[2] == "defaults") || (os.Args[1] == "webrun" && webuiData == "") || (slices.Equal(os.Args[1:], webuiInventoryListParams)) {
if (len(os.Args) > 2 && os.Args[1] == "config" && os.Args[2] == "defaults") || (os.Args[1] == "webrun" && webuiData == "") || (slices.Equal(os.Args[1:], webuiInventoryListParams)) {
return nil
}
// only enable if a feature file is present and belongs to Aerospike internal users
Expand Down
Loading