Skip to content

Commit

Permalink
storage-operator/types: add noFormat option
Browse files Browse the repository at this point in the history
This options allows to skip the formatting of the device.
It's optional and will be set to false by default (i.e., format the
device) to preserve the backward compatibility.

Refs: #2421
Signed-off-by: Sylvain Laperche <[email protected]>
  • Loading branch information
slaperche-scality committed Jun 29, 2020
1 parent d077d08 commit 2febaf8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions storage-operator/deploy/crds/storage_v1alpha1_volume_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,17 @@ spec:
devicePath:
description: Path of the block device on the node to back the PersistentVolume.
type: string
noFormat:
description: When true, do not format the device with a filesystem.
type: boolean
required:
- devicePath
type: object
sparseLoopDevice:
properties:
noFormat:
description: When true, do not format the device with a filesystem.
type: boolean
size:
description: Size of the generated sparse file backing the PersistentVolume.
type: string
Expand Down
6 changes: 6 additions & 0 deletions storage-operator/pkg/apis/storage/v1alpha1/volume_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ import (
type SparseLoopDeviceVolumeSource struct {
// Size of the generated sparse file backing the PersistentVolume.
Size resource.Quantity `json:"size"`
// When true, do not format the device with a filesystem.
// +optional
NoFormat bool `json:"noFormat,omitempty"`
}

type RawBlockDeviceVolumeSource struct {
// Path of the block device on the node to back the PersistentVolume.
DevicePath string `json:"devicePath"`
// When true, do not format the device with a filesystem.
// +optional
NoFormat bool `json:"noFormat,omitempty"`
}

type VolumeSource struct {
Expand Down

0 comments on commit 2febaf8

Please sign in to comment.