Skip to content

Commit

Permalink
Fix inverted HTTP status check logic
Browse files Browse the repository at this point in the history
  • Loading branch information
pvorb committed Nov 3, 2020
1 parent a5cc371 commit 3f15816
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
= Changelog

== Version 2.7.1

* Fix inverted status check which _fails_ for any 2xx HTTP status

== Version 2.7.0

* Accept any 2xx HTTP status code when deploying Helm charts
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/deviceinsight/helm/DeployMojo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class DeployMojo : AbstractMojo() {

httpClient.execute(request).use { response ->
val statusCode = response.statusLine.statusCode
if ( (statusCode >= 200) && (statusCode < 300) ) {
if (statusCode < 200 || statusCode >= 300) {
throw RuntimeException("Unexpected status code when executing $chartPublishMethod request to " +
"chart repo ${chartDeploymentRequest.chartPublishUrl()}: $statusCode")
}
Expand Down

0 comments on commit 3f15816

Please sign in to comment.