refactor: use exit code 137 to signify a lock was unable to be retrieved when calling ps:retire

Closes #5432
This commit is contained in:
Jose Diaz-Gonzalez
2022-11-27 20:23:13 -05:00
parent 38cb05e7b1
commit bc26766b84
3 changed files with 25 additions and 2 deletions

View File

@@ -111,12 +111,12 @@ func CommandRetire(appName string) error {
fileLock := flock.New(lockFile)
locked, err := fileLock.TryLock()
if err != nil {
return fmt.Errorf("Failed to acquire ps:retire lock: %s", err)
return &RetireLockFailed{&err}
}
defer fileLock.Unlock()
if !locked {
return fmt.Errorf("Failed to acquire ps:retire lock")
return &RetireLockFailed{}
}
common.LogInfo1("Retiring old containers and images")