From b6dcefc72d8c203499839a84641aaddf323263d3 Mon Sep 17 00:00:00 2001 From: Adam0Brien Date: Tue, 14 Mar 2023 16:43:32 +0000 Subject: [PATCH] Error being displayed when config is passed in butane --- config.yaml | 9 +++++++++ config/fcos/v1_5_exp/translate.go | 5 ++--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 config.yaml diff --git a/config.yaml b/config.yaml new file mode 100644 index 00000000..da75bc4b --- /dev/null +++ b/config.yaml @@ -0,0 +1,9 @@ +variant: fcos +version: 1.5.0-experimental +storage: + disks: + - device: /dev/sdb + wipe_table: false + partitions: + - label: foo + number: 0 diff --git a/config/fcos/v1_5_exp/translate.go b/config/fcos/v1_5_exp/translate.go index bf102cf8..8a0556fe 100644 --- a/config/fcos/v1_5_exp/translate.go +++ b/config/fcos/v1_5_exp/translate.go @@ -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" @@ -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) } @@ -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 } } }