#415 rhpkg exits with status code 0 even when the task fails
Closed: Fixed 3 years ago by onosek. Opened 3 years ago by goldmann.

Consider following execution:

$ rhpkg container-build --target openjdk-11-rhel7-containers-candidate --scratch
Created task: 20188269
Task info: https://REDACTED/brew/taskinfo?taskID=20188269
Watching tasks (this may be safely interrupted)...
20188269 buildContainer (noarch): free
20188269 buildContainer (noarch): free -> open (x86-vm-17.build.eng.bos.redhat.com)
20188269 buildContainer (noarch): open (x86-vm-17.build.eng.bos.redhat.com) -> FAILED: Fault: <Fault 2001: "Image build failed. Error in plugin pull_base_image: RuntimeError(u'Unable to fetch manifest list for base image',). OSBS build id: scratch-47636-20190213112448">
  0 free  0 open  0 done  1 failed

20188269 buildContainer (noarch) failed
➜  openjdk git:(private-mgoldman-cekit) echo $?

The submitted task failed, but the rhpkg command returned status code 0 suggesting that it was completed successfully. We use rhpkg as part of some tooling and it very hard to find if the task was successful or not. One way of implementing a workaround would be output parsing but this seems to be rather bad idea.

The rhpkg tool should return a non-zero status code when the submitted task fails and return 0 only in cases when the execution was successful.

Metadata Update from @onosek:
- Issue set to the milestone: 1.58

3 years ago

Login to comment on this ticket.

Related Pull Requests
  • #426 Merged 3 years ago