k8snetworkplumbingwg / net-attach-def-admission-controller

An admission controller to check resources as defined by the NPWG spec
Apache License 2.0
4 stars 15 forks source link

panic: webhook flag redefined: log_dir #6

Open dougbtv opened 5 years ago

dougbtv commented 5 years ago
[centos@kube-nonetwork-master net-attach-def-admission-controller]$ kubectl logs net-attach-def-admission-controller-server-765d66c78b-nstmt --namespace=kube-system
webhook flag redefined: log_dir
panic: webhook flag redefined: log_dir
goroutine 1 [running]:
flag.(*FlagSet).Var(0xc42003a120, 0x11e3fe0, 0xc420070d20, 0x1104d9b, 0x7, 0x11281a6, 0x2f)
    /usr/local/go/src/flag/flag.go:810 +0x540
flag.(*FlagSet).StringVar(0xc42003a120, 0xc420070d20, 0x1104d9b, 0x7, 0x0, 0x0, 0x11281a6, 0x2f)
    /usr/local/go/src/flag/flag.go:713 +0x8b
flag.(*FlagSet).String(0xc42003a120, 0x1104d9b, 0x7, 0x0, 0x0, 0x11281a6, 0x2f, 0xc420070d10)
    /usr/local/go/src/flag/flag.go:726 +0x8b
flag.String(0x1104d9b, 0x7, 0x0, 0x0, 0x11281a6, 0x2f, 0xc4200e4800)
    /usr/local/go/src/flag/flag.go:733 +0x69
dougbtv commented 5 years ago

Looks like it was an improper flattening of deps, glog package is included multiple times:

grep -Prin "log_dir" *
vendor/github.com/intel/multus-cni/vendor/github.com/golang/glog/glog.go:49://  -log_dir=""
vendor/github.com/intel/multus-cni/vendor/github.com/golang/glog/glog_file.go:41:var logDir = flag.String("log_dir", "", "If non-empty, write log files in this directory")
vendor/github.com/golang/glog/glog.go:49:// -log_dir=""
vendor/github.com/golang/glog/glog_file.go:41:var logDir = flag.String("log_dir", "", "If non-empty, write log files in this directory")

Went ahead and manually deleted multiple inclusion for now:

rm -Rf vendor/github.com/intel/multus-cni/vendor/github.com/golang/glog/

Plan to PR into develop branch.

przemeklal commented 5 years ago

Hey @dougbtv, I think this could be fixed with --strip-vendor - it will remove nested vendor dirs, inlcuding glog from Multus. Would this be more "clean" solution?