From 3f158160f38e9e6d02c924d19f6d625f4b953dab Mon Sep 17 00:00:00 2001 From: Paul Vorbach Date: Tue, 3 Nov 2020 16:31:38 +0100 Subject: [PATCH] Fix inverted HTTP status check logic --- CHANGELOG.adoc | 4 ++++ src/main/kotlin/com/deviceinsight/helm/DeployMojo.kt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 6f33e79..ba3acf3 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -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 diff --git a/src/main/kotlin/com/deviceinsight/helm/DeployMojo.kt b/src/main/kotlin/com/deviceinsight/helm/DeployMojo.kt index e742276..40a47b1 100644 --- a/src/main/kotlin/com/deviceinsight/helm/DeployMojo.kt +++ b/src/main/kotlin/com/deviceinsight/helm/DeployMojo.kt @@ -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") }