fix: update blockdevice library to properly handle absent GPT

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>
This commit is contained in:
Artem Chernyshev 2021-11-24 00:01:30 +03:00
parent 5ac64b2d97
commit d1f55f9012
No known key found for this signature in database
GPG Key ID: 9B9D0328B57B443F
3 changed files with 5 additions and 3 deletions

2
go.mod
View File

@ -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

3
go.sum
View File

@ -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=

View File

@ -6,6 +6,7 @@ package mount
import (
"context"
"errors"
"fmt"
"log"
"os"
@ -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
}