mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
core: flag blacklisting not needed anymore (#4420)
Automatically submitted.
This commit is contained in:
@@ -35,21 +35,6 @@ func init() {
|
|||||||
// Run is CoreDNS's main() function.
|
// Run is CoreDNS's main() function.
|
||||||
func Run() {
|
func Run() {
|
||||||
caddy.TrapSignals()
|
caddy.TrapSignals()
|
||||||
|
|
||||||
// Reset flag.CommandLine to get rid of unwanted flags for instance from glog (used in kubernetes).
|
|
||||||
// And read the ones we want to keep.
|
|
||||||
flag.VisitAll(func(f *flag.Flag) {
|
|
||||||
if _, ok := flagsBlacklist[f.Name]; ok {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
flagsToKeep = append(flagsToKeep, f)
|
|
||||||
})
|
|
||||||
|
|
||||||
flag.CommandLine = flag.NewFlagSet(os.Args[0], flag.ExitOnError)
|
|
||||||
for _, f := range flagsToKeep {
|
|
||||||
flag.Var(f.Value, f.Name, f.Usage)
|
|
||||||
}
|
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if len(flag.Args()) > 0 {
|
if len(flag.Args()) > 0 {
|
||||||
@@ -197,16 +182,3 @@ var (
|
|||||||
// Gitcommit contains the commit where we built CoreDNS from.
|
// Gitcommit contains the commit where we built CoreDNS from.
|
||||||
GitCommit string
|
GitCommit string
|
||||||
)
|
)
|
||||||
|
|
||||||
// flagsBlacklist removes flags with these names from our flagset.
|
|
||||||
var flagsBlacklist = map[string]struct{}{
|
|
||||||
"logtostderr": {},
|
|
||||||
"alsologtostderr": {},
|
|
||||||
"v": {},
|
|
||||||
"stderrthreshold": {},
|
|
||||||
"vmodule": {},
|
|
||||||
"log_backtrace_at": {},
|
|
||||||
"log_dir": {},
|
|
||||||
}
|
|
||||||
|
|
||||||
var flagsToKeep []*flag.Flag
|
|
||||||
|
|||||||
Reference in New Issue
Block a user