Skip to content

Commit

Permalink
base/0_6_exp/validate.go: Update error and dropped unneccessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam0Brien committed Sep 19, 2023
1 parent c6358d1 commit ba7d124
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions base/v0_6_exp/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions config/common/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Check failure on line 28 in config/common/errors.go

View workflow job for this annotation

GitHub Actions / Regenerate

other declaration of ErrUnknownVersion

// high-level errors for fatal reports
ErrInvalidSourceConfig = errors.New("source config is invalid")
Expand Down

0 comments on commit ba7d124

Please sign in to comment.