k3s/pkg/volume/flexvolume
Kubernetes Submit Queue 86a42b8796 Merge pull request #46973 from php-coder/improve_flex_logging
Automatic merge from submit-queue (batch tested with PRs 46973, 48556)

Improve error reporting when flex driver has failed to initialize

**What this PR does / why we need it**:

This PR improves error reporting for the case when flex driver is failing to initialize. There are 2 improvements:

1) show only the plugin name instead of a full struct. This makes a message shorter and removes useless and internal information.

Before:
>E0605 16:44:59.330215   26786 plugins.go:359] Failed to load volume plugin &{k8s/nfs /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s~nfs %!s(*kubelet.kubeletVolumeHost=&{0xc431ea5800 {{1 0} map[kubernetes.io/downward-api:0xc431ee3f20 kubernetes.io/aws-ebs:0xc431ee3eb0 kubernetes.io/git-repo:0xc431ee3ef0 kubernetes.io/host-path:0xc430e985f0 kubernetes.io/rbd:0xc42bfab840 kubernetes.io/quobyte:0xc431ee3f00 kubernetes.io/fc:0xc42bfab980 kubernetes.io/empty-dir:0xc431ee3ed0 kubernetes.io/nfs:0xc430e98640 kubernetes.io/iscsi:0xc42bfab720 kubernetes.io/glusterfs:0xc430faaba0 kubernetes.io/cinder:0xc42bfab8c0 kubernetes.io/gce-pd:0xc431ee3ee0 kubernetes.io/secret:0xc42bfab6a0 kubernetes.io/flocker:0xc431ee3f30 kubernetes.io/cephfs:0xc431ee3f10]} 0xc42698cf40}) %!s(*exec.executor=&{}) {%!s(int32=0) %!s(uint32=0)} []}, error: unexpected end of JSON input

After:
>E0605 16:59:45.520185   29041 plugins.go:359] Failed to load volume plugin k8s/nfs, error: unexpected end of JSON input

2) quote script output. In case the output was empty, messages look a bit better:

Before:
> E0605 16:44:59.330077   26786 driver-call.go:212] Failed to unmarshal output for command: init, **output: **, error: unexpected end of JSON input
> W0605 16:44:59.330170   26786 driver-call.go:140] FlexVolume: driver call failed: executable: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s\~nfs/nfs, args: [init], error: fork/exec /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s\~nfs/nfs: permission denied, **output: **

After:
>E0605 16:59:45.519906   29041 driver-call.go:212] Failed to unmarshal output for command: init, **output: ""**, error: unexpected end of JSON input
>W0605 16:59:45.520109   29041 driver-call.go:140] FlexVolume: driver call failed: executable: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s\~nfs/nfs, args: [init], error: fork/exec /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s\~nfs/nfs: permission denied, **output: ""**
2017-07-15 18:02:36 -07:00
..
BUILD run hack/update-all 2017-06-22 11:31:03 -07:00
OWNERS remove some people from OWNERS so they don't get reviews anymore 2017-07-13 10:02:21 -07:00
attacher-defaults.go Remove controller node plugin driver dependency for non-attachable flex volume drivers (Ex: NFS). 2017-06-17 14:12:43 -04:00
attacher.go Remove controller node plugin driver dependency for non-attachable flex volume drivers (Ex: NFS). 2017-06-17 14:12:43 -04:00
attacher_test.go Add support for attacher/detacher interface in Flex volume 2017-02-24 20:18:06 -05:00
common_test.go run hack/update-all 2017-06-22 11:31:03 -07:00
detacher-defaults.go Remove controller node plugin driver dependency for non-attachable flex volume drivers (Ex: NFS). 2017-06-17 14:12:43 -04:00
detacher.go Remove controller node plugin driver dependency for non-attachable flex volume drivers (Ex: NFS). 2017-06-17 14:12:43 -04:00
detacher_test.go Add support for attacher/detacher interface in Flex volume 2017-02-24 20:18:06 -05:00
driver-call.go Merge pull request #46973 from php-coder/improve_flex_logging 2017-07-15 18:02:36 -07:00
flexvolume_test.go run hack/update-all 2017-06-22 11:31:03 -07:00
mounter-defaults.go Merge pull request #47503 from chakri-nelluri/flexcap 2017-06-21 21:12:15 -07:00
mounter.go Remove all references to types.UnixUserID and types.UnixGroupID 2017-06-21 04:09:07 -07:00
mounter_test.go run hack/update-all 2017-06-22 11:31:03 -07:00
plugin-defaults.go Add support for attacher/detacher interface in Flex volume 2017-02-24 20:18:06 -05:00
plugin.go run hack/update-all 2017-06-22 11:31:03 -07:00
plugin_test.go Remove broken getvolumename and pass PV or volume name to attach call 2017-06-13 00:32:38 -04:00
probe.go Remove controller node plugin driver dependency for non-attachable flex volume drivers (Ex: NFS). 2017-06-17 14:12:43 -04:00
unmounter-defaults.go Add support for attacher/detacher interface in Flex volume 2017-02-24 20:18:06 -05:00
unmounter.go Add support for attacher/detacher interface in Flex volume 2017-02-24 20:18:06 -05:00
unmounter_test.go Add support for attacher/detacher interface in Flex volume 2017-02-24 20:18:06 -05:00
util.go run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
volume.go Pass pod metadata to flex plugin 2017-05-18 00:49:18 -04:00