Skip to content

Commit acf65c7

Browse files
committed
fix: flag panic if a flag is defined after being set
1 parent e9cd53e commit acf65c7

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pkg/blobplugin/main.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ import (
3131
"k8s.io/klog/v2"
3232
)
3333

34-
func init() {
35-
_ = flag.Set("logtostderr", "true")
36-
}
37-
3834
var (
3935
endpoint = flag.String("endpoint", "unix://tmp/csi.sock", "CSI endpoint")
4036
blobfuseProxyEndpoint = flag.String("blobfuse-proxy-endpoint", "unix://tmp/blobfuse-proxy.sock", "blobfuse-proxy endpoint")
@@ -64,6 +60,7 @@ var (
6460

6561
func main() {
6662
klog.InitFlags(nil)
63+
_ = flag.Set("logtostderr", "true")
6764
flag.Parse()
6865
if *version {
6966
info, err := blob.GetVersionYAML(*driverName)

0 commit comments

Comments
 (0)