Skip to content

Commit

Permalink
chore: various terminology and grammar fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobmoellerdev committed Sep 21, 2023
1 parent 1935462 commit f2b5763
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 50 deletions.
12 changes: 6 additions & 6 deletions api/v1alpha1/lvmvolumegroupnodestatus_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,23 @@ const (
)

type VGStatus struct {
// Name is the name of the VG
// Name is the name of the volume group
Name string `json:"name,omitempty"`
// Status tells if the VG was created on the node
// Status tells if the volume group was created on the node
Status VGStatusType `json:"status,omitempty"`
// Reason provides more detail on the VG creation status
// Reason provides more detail on the volume group creation status
Reason string `json:"reason,omitempty"`
// Devices is the list of devices used by the VG
// Devices is the list of devices used by the volume group
Devices []string `json:"devices,omitempty"`
// Excluded contains the per node status of applied device exclusions that were picked up via selector,
// but were not used for other reasons. It can be consulted in case the device is not picked up as a device for LVM to use.
// but were not used for other reasons.
Excluded []ExcludedDevice `json:"excluded,omitempty"`
}

type ExcludedDevice struct {
// Name is the device that was filtered
Name string `json:"name"`
// Reasons are the human-readable reasons why the device was excluded and could not be used
// Reasons are the human-readable reasons why the device was excluded from the volume group
Reasons []string `json:"reasons"`
}

Expand Down
18 changes: 8 additions & 10 deletions bundle/manifests/lvm.topolvm.io_lvmclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,24 +301,22 @@ spec:
properties:
devices:
description: Devices is the list of devices used by the
VG
volume group
items:
type: string
type: array
excluded:
description: Excluded contains the per node status of
applied device exclusions that were picked up via selector,
but were not used for other reasons. It can be consulted
in case the device is not picked up as a device for
LVM to use.
but were not used for other reasons.
items:
properties:
name:
description: Name is the device that was filtered
type: string
reasons:
description: Reasons are the human-readable reasons
why the device was excluded and could not be used
why the device was excluded from the volume group
items:
type: string
type: array
Expand All @@ -328,18 +326,18 @@ spec:
type: object
type: array
name:
description: Name is the name of the VG
description: Name is the name of the volume group
type: string
node:
description: Node is the name of the node
type: string
reason:
description: Reason provides more detail on the VG creation
status
description: Reason provides more detail on the volume
group creation status
type: string
status:
description: Status tells if the VG was created on the
node
description: Status tells if the volume group was created
on the node
type: string
type: object
type: array
Expand Down
17 changes: 9 additions & 8 deletions bundle/manifests/lvm.topolvm.io_lvmvolumegroupnodestatuses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ spec:
items:
properties:
devices:
description: Devices is the list of devices used by the VG
description: Devices is the list of devices used by the volume
group
items:
type: string
type: array
excluded:
description: Excluded contains the per node status of applied
device exclusions that were picked up via selector, but were
not used for other reasons. It can be consulted in case the
device is not picked up as a device for LVM to use.
not used for other reasons.
items:
properties:
name:
description: Name is the device that was filtered
type: string
reasons:
description: Reasons are the human-readable reasons why
the device was excluded and could not be used
the device was excluded from the volume group
items:
type: string
type: array
Expand All @@ -67,14 +67,15 @@ spec:
type: object
type: array
name:
description: Name is the name of the VG
description: Name is the name of the volume group
type: string
reason:
description: Reason provides more detail on the VG creation
status
description: Reason provides more detail on the volume group
creation status
type: string
status:
description: Status tells if the VG was created on the node
description: Status tells if the volume group was created on
the node
type: string
type: object
type: array
Expand Down
18 changes: 8 additions & 10 deletions config/crd/bases/lvm.topolvm.io_lvmclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -297,24 +297,22 @@ spec:
properties:
devices:
description: Devices is the list of devices used by the
VG
volume group
items:
type: string
type: array
excluded:
description: Excluded contains the per node status of
applied device exclusions that were picked up via selector,
but were not used for other reasons. It can be consulted
in case the device is not picked up as a device for
LVM to use.
but were not used for other reasons.
items:
properties:
name:
description: Name is the device that was filtered
type: string
reasons:
description: Reasons are the human-readable reasons
why the device was excluded and could not be used
why the device was excluded from the volume group
items:
type: string
type: array
Expand All @@ -324,18 +322,18 @@ spec:
type: object
type: array
name:
description: Name is the name of the VG
description: Name is the name of the volume group
type: string
node:
description: Node is the name of the node
type: string
reason:
description: Reason provides more detail on the VG creation
status
description: Reason provides more detail on the volume
group creation status
type: string
status:
description: Status tells if the VG was created on the
node
description: Status tells if the volume group was created
on the node
type: string
type: object
type: array
Expand Down
17 changes: 9 additions & 8 deletions config/crd/bases/lvm.topolvm.io_lvmvolumegroupnodestatuses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ spec:
items:
properties:
devices:
description: Devices is the list of devices used by the VG
description: Devices is the list of devices used by the volume
group
items:
type: string
type: array
excluded:
description: Excluded contains the per node status of applied
device exclusions that were picked up via selector, but were
not used for other reasons. It can be consulted in case the
device is not picked up as a device for LVM to use.
not used for other reasons.
items:
properties:
name:
description: Name is the device that was filtered
type: string
reasons:
description: Reasons are the human-readable reasons why
the device was excluded and could not be used
the device was excluded from the volume group
items:
type: string
type: array
Expand All @@ -67,14 +67,15 @@ spec:
type: object
type: array
name:
description: Name is the name of the VG
description: Name is the name of the volume group
type: string
reason:
description: Reason provides more detail on the VG creation
status
description: Reason provides more detail on the volume group
creation status
type: string
status:
description: Status tells if the VG was created on the node
description: Status tells if the volume group was created on
the node
type: string
type: object
type: array
Expand Down
16 changes: 8 additions & 8 deletions pkg/filter/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ func DefaultFilters(vg *lvmv1alpha1.LVMVolumeGroup, lvmInstance lvm.LVM, lsblkIn

notSuspended: func(dev lsblk.BlockDevice) error {
if dev.State == StateSuspended {
return fmt.Errorf("%s cannot be in suspended", dev.Name)
return fmt.Errorf("%s cannot be in a %q state", dev.State, dev.Name)
}
return nil
},

noInvalidPartitionLabel: func(dev lsblk.BlockDevice) error {
for _, invalidLabel := range invalidPartitionLabels {
if strings.Contains(strings.ToLower(dev.PartLabel), invalidLabel) {
return fmt.Errorf("%s has the invalid %q partition label", dev.Name, dev.PartLabel)
return fmt.Errorf("%s has an invalid partition label %q", dev.Name, dev.PartLabel)
}
}
return nil
Expand All @@ -111,7 +111,7 @@ func DefaultFilters(vg *lvmv1alpha1.LVMVolumeGroup, lvmInstance lvm.LVM, lsblkIn
if dev.FSType == FSTypeLVM2Member {
pvs, err := lvmInstance.ListPVs("")
if err != nil {
return fmt.Errorf("could not determine if %s has valid filesystem signature, since it is flagged as LVM2_member but physical volumes could not be verified: %w", dev.Name, err)
return fmt.Errorf("could not determine if %s has a valid filesystem signature. It is flagged as a LVM2_member but the physical volumes could not be verified: %w", dev.Name, err)
}

var foundPV *lvm.PhysicalVolume
Expand Down Expand Up @@ -142,19 +142,19 @@ func DefaultFilters(vg *lvmv1alpha1.LVMVolumeGroup, lvmInstance lvm.LVM, lsblkIn

// 2. Children and has a volume group that matches the one we want to filter for (it is already used)
if foundPV.VgName != vg.GetName() {
return fmt.Errorf("%s is already LVM2_Member in %s instead of the desired %s and cannot be initialized",
return fmt.Errorf("%s is already a LVM2_Member of another volume group (%s) and cannot be used for the volume group %s",
dev.Name, foundPV.VgName, vg.GetName())
} else {
return fmt.Errorf("%s is already LVM2_Member in %s: %w", dev.Name, vg.GetName(), ErrDeviceAlreadySetupCorrectly)
return fmt.Errorf("%s is already a LVM2_Member of %s: %w", dev.Name, vg.GetName(), ErrDeviceAlreadySetupCorrectly)
}
}
return fmt.Errorf("%s has invalid filesystem signature %s and cannot be used", dev.Name, dev.FSType)
return fmt.Errorf("%s has an invalid filesystem signature (%s) and cannot be used", dev.Name, dev.FSType)
},

noChildren: func(dev lsblk.BlockDevice) error {
hasChildren := dev.HasChildren()
if hasChildren {
return fmt.Errorf("%s has children and should not be considered", dev.Name)
return fmt.Errorf("%s has children block devices and could not be considered", dev.Name)
}
return nil
},
Expand Down Expand Up @@ -182,7 +182,7 @@ func DefaultFilters(vg *lvmv1alpha1.LVMVolumeGroup, lvmInstance lvm.LVM, lsblkIn
return fmt.Errorf("%s is an unusable loopback device: %w", dev.Name, err)
}
case DeviceTypeROM:
return fmt.Errorf("%s has the blacklisted device type %s and cannot be used", dev.Name, dev.Type)
return fmt.Errorf("%s has a device type of %q which is unsupported", dev.Name, dev.Type)
case DeviceTypeLVM:
return ErrLVMPartition
}
Expand Down

0 comments on commit f2b5763

Please sign in to comment.