Skip to content

Commit

Permalink
Error being displayed when config is passed in butane
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam0Brien committed Mar 14, 2023
1 parent 4c242e0 commit b6dcefc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 9 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
variant: fcos
version: 1.5.0-experimental
storage:
disks:
- device: /dev/sdb
wipe_table: false
partitions:
- label: foo
number: 0
5 changes: 2 additions & 3 deletions config/fcos/v1_5_exp/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ package v1_5_exp

import (
"fmt"
"strings"
"log"
"strings"

baseutil "github.com/coreos/butane/base/util"
"github.com/coreos/butane/config/common"
Expand Down Expand Up @@ -73,7 +73,7 @@ func (c Config) ToIgn3_4Unvalidated(options common.TranslateOptions) (types.Conf
if !util.IsTrue(disk.WipeTable) {
for j, partition := range disk.Partitions {
// check for reserved partlabels
if partition.Label != nil {
if partition.Label != nil {
if (*partition.Label == "BIOS-BOOT" && partition.Number != 1) || (*partition.Label == "PowerPC-PReP-boot" && partition.Number != 1) || (*partition.Label == "EFI-SYSTEM" && partition.Number != 2) || (*partition.Label == "boot" && partition.Number != 3) || (*partition.Label == "root" && partition.Number != 4) {
r.AddOnWarn(path.New("json", "storage", "disks", i, "partitions", j, "label"), common.ErrWrongPartitionNumber)
}
Expand Down Expand Up @@ -370,7 +370,6 @@ func isPartitionValid(disk types.Disk) error {
for _, partition := range disk.Partitions {
if partition.Number == 0 {
log.Fatal(common.ErrInvalidPartitionNumber)
return common.ErrInvalidPartitionNumber
}
}
}
Expand Down

0 comments on commit b6dcefc

Please sign in to comment.