kubernetes-csi / csi-driver-host-path

A sample (non-production) CSI Driver that creates a local directory as a volume on a single node
Apache License 2.0
328 stars 210 forks source link

ControllerGetVolume should report abnormal volume condition if volume is not found #338

Closed xing-yang closed 2 years ago

xing-yang commented 3 years ago

If volume is not found, ControllerGetVolume should return abnormal volume condition rather than return nil.

https://github.com/kubernetes-csi/csi-driver-host-path/blob/v1.7.3/pkg/hostpath/controllerserver.go#L466

xing-yang commented 3 years ago

CC @NickrenREN @fengzixu

xing-yang commented 3 years ago

@zhucan This code here should still be fixed in the csi-driver-host-path repo:

https://github.com/kubernetes-csi/csi-driver-host-path/blob/v1.7.3/pkg/hostpath/controllerserver.go#L466

zhucan commented 3 years ago

Test procedure:

  1. disable the “ControllerListVolume” capability in hostpath repo:https://github.com/kubernetes-csi/csi-driver-host-path/blob/76efcbf8658291e4f43ccf3d7a6ac462df8af706/pkg/hostpath/controllerserver.go#L797
  2. make new container for hostpath plugin
  3. deploy new csi hostpath plugin container
  4. create pvc and delete data from state.json: /var/lib/csi-hostpath-data/state.json
  5. restart pods
  6. check the monitior and events events: image

logs: image

CC @xing-yang @NickrenREN @fengzixu

xing-yang commented 3 years ago

@zhucan Other than disabling "ListVolumes", you didn't make any changes to csi-driver-host-path?

pohly commented 3 years ago

Is this meant to become an E2E test somewhere?

You can manipulate the behavior of each CSI call in the hostpath driver on a per-test basis via the proxy feature. Previously that was done via command line parameters, but that is more complicated (first modify driver, release it, then write test).

zhucan commented 3 years ago

@zhucan Other than disabling "ListVolumes", you didn't make any changes to csi-driver-host-path? Modify the responses of the "ControllerGetVolume",https://github.com/kubernetes-csi/csi-driver-host-path/pull/339

@xing-yang

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

xing-yang commented 2 years ago

/remove-lifecycle stale