Skip to content

Commit

Permalink
Reintroduce minimal api-version parameter for Api-Versions < 1.25
Browse files Browse the repository at this point in the history
Since Api-Version header was introduced in 1.25, we should send a minimal api-version
rather than just sending null. See this comment:
   fabric8io#1060 (comment)
  • Loading branch information
rohanKanojia committed Jan 13, 2019
1 parent 670152c commit c79ebcb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ChangeLog

* 0.28.1
- Reintroduce minimal API-VERSION parameter in order to support docker versions below apiVersion 1.25

* **0.28.0** (2018-12-13)
- Update to JMockit 1.43
- Compiles with Java 11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ public class DockerAccessWithHcClient implements DockerAccess {
// Base URL which is given through when using NamedPipe communication but is not really used
private static final String NPIPE_URL = "npipe://127.0.0.1:1/";

// Minimal API version, independent of any feature used
public static final String API_VERSION = "1.18";

// Logging
private final Logger log;

Expand Down Expand Up @@ -721,6 +724,6 @@ public String fetchApiVersionFromServer(String baseUrl, ApacheHttpClientDelegate
get.addHeader(HttpHeaders.CONTENT_TYPE, "application/json");
CloseableHttpResponse response = delegate.getHttpClient().execute(get);

return response.getFirstHeader("Api-Version") != null ? response.getFirstHeader("Api-Version").getValue() : null;
return response.getFirstHeader("Api-Version") != null ? response.getFirstHeader("Api-Version").getValue() : API_VERSION;
}
}

0 comments on commit c79ebcb

Please sign in to comment.