Skip to content

Commit

Permalink
(feat): Suggestions from Pull Request
Browse files Browse the repository at this point in the history
  • Loading branch information
lasith-kg committed May 20, 2024
1 parent 382cecc commit dfc92fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion configs/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ devices:
mountPoint: /mnt/bar
user: ubuntu
group: ubuntu
permissions: 755
permissions: 755
5 changes: 2 additions & 3 deletions internal/config/modifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ func NewLvmModifier() *LvmModifier {
}

func (lm *LvmModifier) Modify(c *Config) error {
// Fetch a copy of the original keys as we are updating
// the config in-place and it is unsafe to iterate over it
// directly
// Fetch a copy of the original keys as we are updating the
// config in-place and it is unsafe to iterate over it directly
keys := make([]string, len(c.Devices))
for name := range c.Devices {
keys = append(keys, name)
Expand Down
2 changes: 2 additions & 0 deletions internal/datastructures/lvm_graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ func (lg *LvmGraph) GetLogicalVolume(name string, vg string) (*LvmNode, error) {
func (lg *LvmGraph) GetParents(node *LvmNode, state LvmNodeCategory) []*LvmNode {
parents := []*LvmNode{}
for _, p := range node.parents {
// Bitmasking to check if the parent nodes is of the desired category
if int32(p.State)&int32(state) > 0 {
parents = append(parents, p)
}
Expand All @@ -207,6 +208,7 @@ func (lg *LvmGraph) GetParents(node *LvmNode, state LvmNodeCategory) []*LvmNode
func (lg *LvmGraph) GetChildren(node *LvmNode, state LvmNodeCategory) []*LvmNode {
children := []*LvmNode{}
for _, c := range node.children {
// Bitmasking to check if children nodes is of the desired category
if int32(c.State)&int32(state) > 0 {
children = append(children, c)
}
Expand Down

0 comments on commit dfc92fe

Please sign in to comment.