-
- Downloads
Fix parsing --drain-priority-config
The --drain-priority-config flag was only parsed if isFlagPassed() returned true for it. However, isFlagPassed() would actually silently never work. The implementation relied on walking the flags parsed by the standard Go "flag" pkg. This seems like it would work since CA defines its flags using the standard "flag" pkg. However, the flags are then actually parsed and processed by the "github.com/spf13/pflag" pkg, so isFlagPassed() could never see them. This commit replaces removes isFlagPassed() and replaces the calls with a pkg-provided pflag.CommandLine.Changed(). Unit tests are added to verify that the flag is correctly parsed after this change.
Loading
Please register or sign in to comment