mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
Quadlet: exit 0 when there are no files to process
Quadlet should not exit with failure if no files to process have been found. Otherwise, even simple operations such as reloading systemd will fail as it retriggers generators. Fixes: #17374 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -327,8 +327,10 @@ func main() {
|
||||
}
|
||||
|
||||
if len(units) == 0 {
|
||||
// containers/podman/issues/17374: exit cleanly but log that we
|
||||
// had nothing to do
|
||||
Debugf("No files to parse from %s", sourcePaths)
|
||||
os.Exit(1)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
if !dryRun {
|
||||
|
@ -365,7 +365,7 @@ var _ = Describe("quadlet system generator", func() {
|
||||
|
||||
session := podmanTest.Quadlet([]string{"-dryrun"}, "/something")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(1))
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
current := session.ErrorToStringArray()
|
||||
expected := "No files to parse from [/something]"
|
||||
|
Reference in New Issue
Block a user