Skip to content

Fix exit code of `docker exec` command not being used

Ollie Shotton requested to merge exit-codes into main

Call os.exit at the top level so that:

  • event metrics are still emitted
  • all defered methods have been run

  • Didn't use os.Exit in DockerExec as that would prevent defered methods from being run
  • Didn't use os.Exit in each of the sub commands as that would prevent metric events from being emitted
  • Didn't use cobra.Command.RunE and return an error as they aren't all errors and the usage text is displayed

Bug: T307583

TODO

  • Update changelog
  • Remove WIP: prefix from commit message
Edited by Ollie Shotton

Merge request reports