mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 06:20:11 +01:00
feat(block): adding block volume support for ZFSPV (#102)
This commit adds the support for creating a Raw Block Volume request using volumemode as block in PVC :-
```
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: block-claim
spec:
volumeMode: Block
storageClassName: zfspv-block
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
```
The driver will create a zvol for this volume and bind mount the block device at the given path.
Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
parent
49dc99726b
commit
dd059a2f43
10 changed files with 274 additions and 10 deletions
|
|
@ -254,6 +254,29 @@ func (b *Builder) WithVolumeMountsNew(volumeMounts []corev1.VolumeMount) *Builde
|
|||
return b
|
||||
}
|
||||
|
||||
// WithVolumeDevicesNew sets the command arguments of the container
|
||||
func (b *Builder) WithVolumeDevicesNew(volumeDevices []corev1.VolumeDevice) *Builder {
|
||||
if volumeDevices == nil {
|
||||
b.errors = append(
|
||||
b.errors,
|
||||
errors.New("failed to build container object: nil volumeDevices"),
|
||||
)
|
||||
return b
|
||||
}
|
||||
|
||||
if len(volumeDevices) == 0 {
|
||||
b.errors = append(
|
||||
b.errors,
|
||||
errors.New("failed to build container object: missing volumeDevices"),
|
||||
)
|
||||
return b
|
||||
}
|
||||
newvolumeDevices := []corev1.VolumeDevice{}
|
||||
newvolumeDevices = append(newvolumeDevices, volumeDevices...)
|
||||
b.con.VolumeDevices = newvolumeDevices
|
||||
return b
|
||||
}
|
||||
|
||||
// WithImagePullPolicy sets the image pull policy of the container
|
||||
func (b *Builder) WithImagePullPolicy(policy corev1.PullPolicy) *Builder {
|
||||
if len(policy) == 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue