I'm not able to compile the hostpath provisioner with the latest version of go i/e 1.9.2.
Is it broken?
[root@kubernetes hostpath-provisioner]# make
CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o hostpath-provisioner .
./hostpath-provisioner.go:57:11: cannot use hostPathProvisioner literal (type hostPathProvisioner) as type controller.Provisioner in return argument:
*hostPathProvisioner does not implement controller.Provisioner (wrong type for Delete method)
have Delete("external-storage/vendor/k8s.io/api/core/v1".PersistentVolume) error
want Delete("external-storage/docs/demo/hostpath-provisioner/vendor/k8s.io/client-go/pkg/api/v1".PersistentVolume) error
./hostpath-provisioner.go:61:5: cannot use hostPathProvisioner literal (type *hostPathProvisioner) as type controller.Provisioner in assignment:
*hostPathProvisioner does not implement controller.Provisioner (wrong type for Delete method)
have Delete("external-storage/vendor/k8s.io/api/core/v1".PersistentVolume) error
want Delete("external-storage/docs/demo/hostpath-provisioner/vendor/k8s.io/client-go/pkg/api/v1".PersistentVolume) error
./hostpath-provisioner.go:72:13: cannot use "external-storage/docs/demo/hostpath-provisioner/vendor/k8s.io/apimachinery/pkg/apis/meta/v1".ObjectMeta literal (type "external-storage/docs/demo/hostpath-provisioner/vendor/k8s.io/apimachinery/pkg/apis/meta/v1".ObjectMeta) as type "external-storage/vendor/k8s.io/apimachinery/pkg/apis/meta/v1".ObjectMeta in field value
./hostpath-provisioner.go:79:33: cannot use options.PersistentVolumeReclaimPolicy (type "external-storage/docs/demo/hostpath-provisioner/vendor/k8s.io/client-go/pkg/api/v1".PersistentVolumeReclaimPolicy) as type "external-storage/vendor/k8s.io/api/core/v1".PersistentVolumeReclaimPolicy in field value
./hostpath-provisioner.go:80:15: cannot use options.PVC.Spec.AccessModes (type []"external-storage/docs/demo/hostpath-provisioner/vendor/k8s.io/client-go/pkg/api/v1".PersistentVolumeAccessMode) as type []"external-storage/vendor/k8s.io/api/core/v1".PersistentVolumeAccessMode in field value
./hostpath-provisioner.go:82:40: cannot use options.PVC.Spec.Resources.Requests["external-storage/vendor/k8s.io/api/core/v1".ResourceName("external-storage/vendor/k8s.io/api/core/v1".ResourceStorage)] (type "external-storage/docs/demo/hostpath-provisioner/vendor/k8s.io/apimachinery/pkg/api/resource".Quantity) as type "external-storage/vendor/k8s.io/apimachinery/pkg/api/resource".Quantity in map value
./hostpath-provisioner.go:82:77: cannot use "external-storage/vendor/k8s.io/api/core/v1".ResourceName("external-storage/vendor/k8s.io/api/core/v1".ResourceStorage) (type "external-storage/vendor/k8s.io/api/core/v1".ResourceName) as type "external-storage/docs/demo/hostpath-provisioner/vendor/k8s.io/client-go/pkg/api/v1".ResourceName in map index
./hostpath-provisioner.go:144:41: not enough arguments in call to controller.NewProvisionController
have (kubernetes.Clientset, string, controller.Provisioner, string)
want (kubernetes.Interface, time.Duration, string, controller.Provisioner, string, bool, int, time.Duration, time.Duration, time.Duration, time.Duration)
make: * [hostpath-provisioner] Error 2
the same...have you resolved it?
I was unable to reproduce this error. I successfully built the hostpath-provisioner on two different macs, one with go 1.9.2 and the other with go 1.9.3.
Is hostpath-provisioner located at the following path: ${GOPATH}/src/github.com/kubernetes-incubator/external-storage/docs/demo/hostpath-provisioner?
I was unable to make the hostpath-provisioner successfully when it was located at a different path.
@ianchakeres Thanks a lot !!! I resolved the problem by changing the path eventually!
@ZhaokunQiu - I'm glad that you got things working.
@gaurang1988 - Any luck on your side? If you also got things working, let's close this issue.
Hi,
@ianchakeres I'm able to build the code when the hostpath-provisioner is located at the path you mentioned. Thanks for your help.
Most helpful comment
Is hostpath-provisioner located at the following path: ${GOPATH}/src/github.com/kubernetes-incubator/external-storage/docs/demo/hostpath-provisioner?
I was unable to make the hostpath-provisioner successfully when it was located at a different path.