osbuild-worker-executor: fix tar warning and log unexpected output
This commit fixes a warning from tar that the archive cannot contain itself. It also makes any tar output a warning (maybe even an error?) as we do not expect anything from the tar command. The test is updated to also check this.
This commit is contained in:
parent
1f52150ff1
commit
22769305d8
2 changed files with 11 additions and 2 deletions
|
|
@ -85,6 +85,7 @@ func runOsbuild(logger *logrus.Logger, buildDir string, control *controlJSON, ou
|
|||
// #nosec G204
|
||||
cmd = exec.Command(
|
||||
"tar",
|
||||
"--exclude=output/output.tar",
|
||||
"-Scf",
|
||||
filepath.Join(outputDir, "output.tar"),
|
||||
"output",
|
||||
|
|
@ -97,7 +98,10 @@ func runOsbuild(logger *logrus.Logger, buildDir string, control *controlJSON, ou
|
|||
_, _ = mw.Write([]byte(err.Error()))
|
||||
return "", err
|
||||
}
|
||||
logger.Infof("tar output:\n%s", out)
|
||||
if len(out) > 0 {
|
||||
logger.Warnf("unexpected tar output:\n%s", out)
|
||||
}
|
||||
|
||||
return outputDir, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue