Skip to content

Commit

Permalink
Don't use HOME env in the my-cnf config
Browse files Browse the repository at this point in the history
Use a relative file as the default for the .my.cnf style configuration.

Fixes: #633

Signed-off-by: SuperQ <superq@gmail.com>
  • Loading branch information
SuperQ committed Jun 19, 2023
1 parent 2b7699b commit 875660e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

BREAKING CHANGES:

Don't prepend the `.my.cnf` file with the `HOME` environment.

Changes:

* [CHANGE] Don't use HOME env in the my-cnf config path. #635

* [CHANGE]
* [FEATURE]
* [ENHANCEMENT]
Expand Down
3 changes: 1 addition & 2 deletions mysqld_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"context"
"net/http"
"os"
"path"
"strconv"
"time"

Expand Down Expand Up @@ -48,7 +47,7 @@ var (
configMycnf = kingpin.Flag(
"config.my-cnf",
"Path to .my.cnf file to read MySQL credentials from.",
).Default(path.Join(os.Getenv("HOME"), ".my.cnf")).String()
).Default(".my.cnf").String()
mysqldAddress = kingpin.Flag(
"mysqld.address",
"Address to use for connecting to MySQL",
Expand Down

0 comments on commit 875660e

Please sign in to comment.