Must use mountlabel when creating builtin volumes

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2023-02-21 16:18:15 -05:00
parent 80be8c3d64
commit b5a99e0816
13 changed files with 120 additions and 24 deletions

View File

@ -1665,6 +1665,18 @@ func WithVolumeLabels(labels map[string]string) VolumeCreateOption {
}
}
// WithVolumeMountLabel sets the MountLabel of the volume.
func WithVolumeMountLabel(mountLabel string) VolumeCreateOption {
return func(volume *Volume) error {
if volume.valid {
return define.ErrVolumeFinalized
}
volume.config.MountLabel = mountLabel
return nil
}
}
// WithVolumeOptions sets the options of the volume.
func WithVolumeOptions(options map[string]string) VolumeCreateOption {
return func(volume *Volume) error {