Skip to content

Commit

Permalink
fix(k8s): unreachable code when kubectl diff errors
Browse files Browse the repository at this point in the history
Closes #786
  • Loading branch information
edvald authored and thsig committed Jun 20, 2019
1 parent 487637f commit 29ae098
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions garden-service/src/plugins/kubernetes/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,14 +473,11 @@ export async function compareDeployedObjects(
// Exited with non-zero code. Check for error messages on stderr. If one is there, the command was unable to
// complete the check, so we fall back to our own mechanism. Otherwise the command worked, but one or more
// resources are missing or outdated.
if (
!err.detail || !err.detail.result
|| (!!err.detail.result.stderr && err.detail.result.stderr.trim() !== "exit status 1")
) {
if (err.stderr && err.stderr.trim() !== "exit status 1") {
log.verbose(`kubectl diff failed: ${err.message}\n${err.stderr}`)
} else {
log.verbose(`kubectl diff indicates one or more resources are outdated.`)
log.silly(err.detail.result.stdout)
log.silly(err.stdout)
result.state = "outdated"
return result
}
Expand Down

0 comments on commit 29ae098

Please sign in to comment.