Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This seems to be related to a change in the klog library where the "v" flag isn't defined until after InitFlags() is called. Defer the call of setting the default verbosity until after we do that instead of during init(). Fixes startup: $ GO_FLAGS=-trimpath build/build.sh && _output/cadvisor -logtostderr >> building cadvisor go: downloading github.com/prometheus/common v0.38.0 panic: flag v set at github.com/google/cadvisor/cmd/cadvisor.go:105 before being defined goroutine 1 [running]: flag.(*FlagSet).Var(0xc00017a150, {0x1874460, 0x2213bc8}, {0x1866490, 0x1}, {0x15f0596, 0x22}) flag/flag.go:1031 +0x33a k8s.io/klog/v2.InitFlags.func1(0xc0001ab2f0?) k8s.io/klog/[email protected]/klog.go:439 +0x31 flag.(*FlagSet).VisitAll(0xc00032fa50?, 0xc0005e1c90) flag/flag.go:458 +0x42 k8s.io/klog/v2.InitFlags(0x7fbe00b2f5b8?) k8s.io/klog/[email protected]/klog.go:438 +0x45 main.main() github.com/google/cadvisor/cmd/cadvisor.go:109 +0x36 Signed-off-by: Joe Groocock <[email protected]>
- Loading branch information