Skip to content

Logging is too silent by default when CSI driver is misconfigured #305

Open
@ebblake

Description

@ebblake

I was trying to add this sidecar to my CSI driver, but my pod was stuck in a CrashLoopBackOff state. kubectl logs mydriverpod -c csi-health-monitor was unhelpful:

$ kubectl logs -n kubesan-system csi-controller-plugin-65776bcb7-68mm8 -c csi-health-monitor
I0116 18:48:15.917448       1 main.go:104] "Version" version="v0.14.0"
I0116 18:48:15.919201       1 common.go:143] "Probing CSI driver for readiness"
$ 

I traced it down to a missing advertisement of csi.ControllerServiceCapability_RPC_LIST_VOLUME_CONDITION in my ControllerGetCapabilities() gRPC call, but it took me adding a --v=2 argument to the command line of the sidecar.

Best practice when failing fast due to misconfiguration is to be verbose about what was misconfigured, rather than hiding it behind V(2), so that the logs can serve as a useful pointer for how to correct the misconfiguration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions