gitlab-runner verify exists with 0 exit code on error

Summary

When you do a gitlab-runner verify for a runner which is not registered, it correctly reports and error, but the error code is '0', this breaks most automation tools which rely on the convention of rc=0 to indicate a success

Steps to reproduce

  • register a runner
  • verify the runner successfully registered
  • remove the runner from the gilab ui
  • verify the runner correctly reports it has been removed
  • check the exit code, it reports '0'

Expected behavior

I expect to get a non-zero exit code for an error saying runner has been removed

Relevant logs and/or screenshots

ubuntu@ubuntu-xenial:~$ sudo gitlab-runner verify
Running in system-mode.

Verifying runner... is alive                        runner=0a01b5ae
ubuntu@ubuntu-xenial:~$ sudo gitlab-runner verify
Running in system-mode.

ERROR: Verifying runner... is removed               runner=0a01b5ae
ubuntu@ubuntu-xenial:~$ echo $?
0

Environment description

I am using using a custom installation

Used GitLab Runner version

ubuntu@ubuntu-xenial:~$ gitlab-runner --version
Version:      1.10.0
Git revision: 4a71a97
Git branch:   master
GO version:   go1.7.4
Built:        Sun, 22 Jan 2017 11:48:31 +0000
OS/Arch:      linux/amd64