Skip to content

Commit

Permalink
fix: update blockdevice library to properly handle absent GPT
Browse files Browse the repository at this point in the history
Next blockdevice library release reads MBR along with GPT and raises
an error if GPT is not set.

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
  • Loading branch information
Unix4ever committed Nov 23, 2021
1 parent 5ac64b2 commit d1f55f9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ require (
github.com/talos-systems/crypto v0.3.4
github.com/talos-systems/discovery-api v0.1.0
github.com/talos-systems/discovery-client v0.1.0
github.com/talos-systems/go-blockdevice v0.2.4
github.com/talos-systems/go-blockdevice v0.2.5-0.20211123181846-15b182db0cd2
github.com/talos-systems/go-cmd v0.1.0
github.com/talos-systems/go-debug v0.2.1
github.com/talos-systems/go-kmsg v0.1.1
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1061,8 +1061,9 @@ github.com/talos-systems/discovery-api v0.1.0 h1:aKod6uqakH6VfeQ6HaxPF7obqFAL1QT
github.com/talos-systems/discovery-api v0.1.0/go.mod h1:ZsbzzOC5bzToaF3+YvUXDf9paeWV5bedpDu5RPXrglM=
github.com/talos-systems/discovery-client v0.1.0 h1:m+f96TKGFckMWrhDI+o9+QhcGn8f1A61Jp6YYVwiulI=
github.com/talos-systems/discovery-client v0.1.0/go.mod h1:LxqCv16VBB68MgaMnV8jXujYd3Q097DAn22U5gaHmkU=
github.com/talos-systems/go-blockdevice v0.2.4 h1:/E5I95byCxfdmQIiBEyWgdUo+6vPBbbOJQIF9+yeysU=
github.com/talos-systems/go-blockdevice v0.2.4/go.mod h1:qnn/zDc09I1DA2BUDDCOSA2D0P8pIDjN8pGiRoRaQig=
github.com/talos-systems/go-blockdevice v0.2.5-0.20211123181846-15b182db0cd2 h1:UJaXJFJgoYVvcJayPQ8TuBN+17iFVhIOQl0Eu9sr+qY=
github.com/talos-systems/go-blockdevice v0.2.5-0.20211123181846-15b182db0cd2/go.mod h1:qnn/zDc09I1DA2BUDDCOSA2D0P8pIDjN8pGiRoRaQig=
github.com/talos-systems/go-cmd v0.0.0-20210216164758-68eb0067e0f0/go.mod h1:kf+rZzTEmlDiYQ6ulslvRONnKLQH8x83TowltGMhO+k=
github.com/talos-systems/go-cmd v0.1.0 h1:bqPeL0ksproFyTOlvMisdUXc7uAf0aqJ5Q6waSGv32s=
github.com/talos-systems/go-cmd v0.1.0/go.mod h1:kf+rZzTEmlDiYQ6ulslvRONnKLQH8x83TowltGMhO+k=
Expand Down
3 changes: 2 additions & 1 deletion internal/pkg/mount/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package mount

import (
"context"
"errors"
"fmt"
"log"
"os"
Expand Down Expand Up @@ -77,7 +78,7 @@ func SystemMountPointForLabel(device *blockdevice.BlockDevice, label string, opt
}

part, err := device.GetPartition(label)
if err != nil && err != os.ErrNotExist {
if err != nil && !errors.Is(err, os.ErrNotExist) {
return nil, err
}

Expand Down

0 comments on commit d1f55f9

Please sign in to comment.