From ba7d124d9863c3e1b9a8ee71060f7bb241735ab8 Mon Sep 17 00:00:00 2001 From: Adam0Brien Date: Tue, 19 Sep 2023 07:19:35 +0100 Subject: [PATCH] base/0_6_exp/validate.go: Update error and dropped unneccessary code --- base/v0_6_exp/validate.go | 6 +----- config/common/errors.go | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/base/v0_6_exp/validate.go b/base/v0_6_exp/validate.go index feb8f877..5b8b8a26 100644 --- a/base/v0_6_exp/validate.go +++ b/base/v0_6_exp/validate.go @@ -46,18 +46,14 @@ func (rs Resource) Validate(c path.ContextPath) (r report.Report) { } if field == "local" || field == "inline" { // check if it's an ignition config - if len(config) > 0 && config[0] == '{' { _, report, err := exp.Parse([]byte(config)) if len(report.Entries) > 0 { butaneReport = MapIgnitionReportToButane(report) r.Merge(butaneReport) } if err != nil { - if err == common.ErrNoFilesDir { - r.AddOnError(c.Append(field), common.ErrNoFilesDir) - } + r.AddOnWarn(c.Append(field), common.ErrUnknownVersion) } - } } return diff --git a/config/common/errors.go b/config/common/errors.go index a5f8d5b2..ffc962d5 100644 --- a/config/common/errors.go +++ b/config/common/errors.go @@ -25,6 +25,7 @@ var ( // common field parsing ErrNoVariant = errors.New("error parsing variant; must be specified") ErrInvalidVersion = errors.New("error parsing version; must be a valid semver") + ErrUnknownVersion = errors.New("config version unknown, butane validation has been skipped") // high-level errors for fatal reports ErrInvalidSourceConfig = errors.New("source config is invalid")