storage: introduce CSIDriver.Spec.VolumeLifecycleModes

Using a "normal" CSI driver for an inline ephemeral volume may have
unexpected and potentially harmful effects when the driver gets a
NodePublishVolume call that it isn't expecting. To prevent that mistake,
driver deployments for a driver that supports such volumes must:
- deploy a CSIDriver object for the driver
- list "ephemeral" as one of the supported modes

The default is "persistent", so existing deployments continue to work
and are automatically protected against incorrect usage.

This commit contains the API change. Generated code and manual code
which uses the new API follow.
This commit is contained in:
Patrick Ohly
2019-07-24 08:16:43 +02:00
parent f22b67dd8f
commit 029fd47757
8 changed files with 343 additions and 2 deletions

View File

@@ -344,6 +344,7 @@ API rule violation: list_type_missing,k8s.io/api/storage/v1,StorageClassList,Ite
API rule violation: list_type_missing,k8s.io/api/storage/v1,VolumeAttachmentList,Items
API rule violation: list_type_missing,k8s.io/api/storage/v1alpha1,VolumeAttachmentList,Items
API rule violation: list_type_missing,k8s.io/api/storage/v1beta1,CSIDriverList,Items
API rule violation: list_type_missing,k8s.io/api/storage/v1beta1,CSIDriverSpec,VolumeLifecycleModes
API rule violation: list_type_missing,k8s.io/api/storage/v1beta1,CSINodeDriver,TopologyKeys
API rule violation: list_type_missing,k8s.io/api/storage/v1beta1,CSINodeList,Items
API rule violation: list_type_missing,k8s.io/api/storage/v1beta1,CSINodeSpec,Drivers