Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Vendoring might need to be looked at ... Runtime errors in glusterfs due to duplicate flags initialized #1120

Closed
jayunit100 opened this issue Feb 5, 2019 · 8 comments

Comments

@jayunit100
Copy link
Contributor

I was able to build these containers using make container but then, i got this :

[root@ip-10-0-1-136 glusterfs]# kubectl logs gluster-dynamic-provisioner-k8gdp
/glusterfs-simple-provisioner flag redefined: log_dir
panic: /glusterfs-simple-provisioner flag redefined: log_dir
goroutine 1 [running]:
flag.(*FlagSet).Var(0xc0000a0120, 0x1487fe0, 0x1fdde10, 0x1311701, 0x7, 0x133aa2f, 0x2f)
	/root/.gimme/versions/go1.11.linux.amd64/src/flag/flag.go:805 +0x529
flag.(*FlagSet).StringVar(0xc0000a0120, 0x1fdde10, 0x1311701, 0x7, 0x0, 0x0, 0x133aa2f, 0x2f)
	/root/.gimme/versions/go1.11.linux.amd64/src/flag/flag.go:708 +0x8a
github.com/kubernetes-incubator/external-storage/vendor/k8s.io/klog.InitFlags(0xc0000a0120)
	/home/centos/go/src/github.com/kubernetes-incubator/external-storage/vendor/k8s.io/klog/klog.go:411 +0x7b
main.main()
	/home/centos/go/src/github.com/kubernetes-incubator/external-storage/gluster/glusterfs/cmd/glusterfs-simple-provisioner/main.go:42 +0x6a

After hacking around some, noticed that theres a bunch of top level vendor dirs

../../../external-storage/repo-infra/vendor/github.com/golang/glog/glog.go://	-log_dir=""
../../../external-storage/repo-infra/vendor/github.com/golang/glog/glog_file.go:// var logDir = flag.String("log_dir2", "", "If non-empty, write log files in this directory")
../../../external-storage/vendor/github.com/golang/glog/glog.go://	-log_dir=""
../../../external-storage/vendor/github.com/golang/glog/glog_file.go:var logDir = flag.String("log_dir", "", "If non-empty, write log files in this directory")
../../../external-storage/vendor/k8s.io/klog/klog.go://	-log_dir=""
../../../external-storage/vendor/k8s.io/klog/klog.go:	flagset.StringVar(&logging.logDir, "log_dir", "", "If non-empty, write log files in this directory")

So , i figured I'd gut em all... and then, compilation failed b/c the deps were missing, so i used dep to ensure all the dependencies, and then everything was happy, except that they types on GlusterfsPersistentVolume were off:

pkg/volume/provision.go:117:5: cannot use r (type *"github.com/kubernetes-incubator/external-storage/gluster/glusterfs/vendor/k8s.io/api/core/v1".GlusterfsVolumeSource) as type *"github.com/kubernetes-incubator/external-storage/gluster/glusterfs/vendor/k8s.io/api/core/v1".GlusterfsPersistentVolumeSource in field value

So, finally, made a tiny change #1119 , which seemed to fix the issue....

@jayunit100 jayunit100 changed the title Runtime errors in glusterfs due to duplicate flags initialized Vendoring might need to be looked at ... Runtime errors in glusterfs due to duplicate flags initialized Feb 5, 2019
@jayunit100
Copy link
Contributor Author

jayunit100 commented Feb 5, 2019

Vendoring did not solve the issue...

However its an easy fix ~ replace 'glog' dependencies in vendor w/ klog.

  200  vi vendor/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/controller/controller.go 
  201  vi ./vendor/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/gidallocator/gidallocator.go
  202  vi ./vendor/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/util/util.go

my other PR around Vendoring didnt solve this problem, so i closed it.

@jayunit100
Copy link
Contributor Author

Ill make some PR's into the sig-storage-lib-external-provisioner repo to fix that , per conv w @dims

@jayunit100
Copy link
Contributor Author

Ok, so once this merges , kubernetes-sigs/sig-storage-lib-external-provisioner#25 , maybe can try updating deps in here.

@humblec
Copy link
Contributor

humblec commented Feb 5, 2019

@jayunit100 I think the easiest fix would be just reverting the changes in https://github.com/kubernetes-incubator/external-storage/pull/1114/files . Are you able to overcome this error once you revert the above mentioned PR ?

@humblec
Copy link
Contributor

humblec commented Feb 5, 2019

@jayunit100 I think the easiest fix would be just reverting the changes in https://github.com/kubernetes-incubator/external-storage/pull/1114/files . Are you able to overcome this error once you revert the above mentioned PR ?

hmmm.. may be this revert is not required and the issue reported here should be solved by kubernetes-sigs/sig-storage-lib-external-provisioner#25 . Isnt it @wongma7 @jayunit100 ?

@humblec
Copy link
Contributor

humblec commented Feb 5, 2019

For safer side I have filed #1122

@jayunit100
Copy link
Contributor Author

@humblec ok cool, that sounds like a good way forward

I also created an image from this branch, that is working for me , https://hub.docker.com/r/jayunit100/glusterfs-simple-provisioner can be slotted in as needed.

@humblec
Copy link
Contributor

humblec commented Feb 6, 2019

@humblec ok cool, that sounds like a good way forward

I also created an image from this branch, that is working for me , https://hub.docker.com/r/jayunit100/glusterfs-simple-provisioner can be slotted in as needed.

@jayunit100 are you saying after reverting pr#1114, things are working fine ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants