-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
area/v2relates to / is being considered for v2relates to / is being considered for v2kind/bugdescribes or fixes a bugdescribes or fixes a bugstatus/triagemaintainers still need to look into thismaintainers still need to look into this
Description
My urfave/cli version is v2.27.1
Dependency Management
- I am unsure of what my dependency management setup is.
Describe the bug
FilePath does not take precedence over EnvVar as described in documentation.
To reproduce
- Set some flag
&cli.StringFlag{
EnvVars: []string{"WOODPECKER_DATABASE_DATASOURCE"},
Name: "datasource",
Usage: "database driver configuration string",
Value: "woodpecker.sqlite",
FilePath: os.Getenv("WOODPECKER_DATABASE_DATASOURCE_FILE"),
},- Set EnvVar:
export WOODPECKER_DATABASE_DATASOURCE=/var/lib/woodpecker/woodpecker.sqlite
- Set FilePath variable:
export WOODPECKER_DATABASE_DATASOURCE_FILE=/run/secrets/woodpecker-datasource.conf
- Get
/var/lib/woodpecker/woodpecker.sqliteinstead/run/secrets/woodpecker-datasource.confindatasourceflag.
Observed behavior
Step 4.
Expected behavior
FilePath should take precedence over EnvVar. So, I should get /run/secrets/woodpecker-datasource.conf in datasource flag.
Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/v2relates to / is being considered for v2relates to / is being considered for v2kind/bugdescribes or fixes a bugdescribes or fixes a bugstatus/triagemaintainers still need to look into thismaintainers still need to look into this