Merge pull request #21164 from rhatdan/quadlet

Error messages not being reported unless more then one error present
This commit is contained in:
openshift-merge-bot[bot] 2024-01-05 10:54:39 +00:00 committed by GitHub
commit 79e4779558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -230,7 +230,9 @@ func loadUnitsFromDir(sourcePath string) ([]*parser.UnitFile, error) {
if f, err := parser.ParseUnitFile(path); err != nil {
err = fmt.Errorf("error loading %q, %w", path, err)
if prevError != nil {
if prevError == nil {
prevError = err
} else {
prevError = fmt.Errorf("%s\n%s", prevError, err)
}
} else {

View File

@ -639,6 +639,7 @@ BOGUS=foo
session := podmanTest.Quadlet([]string{"-dryrun"}, podmanTest.TempDir)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(1))
Expect(session.ErrorToString()).To(ContainSubstring("converting \"bogus.container\": unsupported key 'BOGUS' in group 'Container' in " + quadletfilePath))
})
It("Should scan and return output for files in subdirectories", func() {