Closed d4n13lbc closed 7 years ago
is this backwards compatible with previous versions of docker? If not then we can attempt this do a rescue with the old logic in place to remain backwards compatible.
It looks like there are support for [State][Running] since 1.18 version (I checked the different api versions of the documentation https://docs.docker.com/engine/api/v1.18/ and others) . It looks like [State][Status] is supported since 1.21 version.
OK lets either check the version and make the appropriate changes or try new method and rescue and then try the older version.
This fix should work for all documented versions. I don't see documentation for previous versions (<1.18) and not even [State][Status] existed before 1.21. It is possible to add to travis unit tests for these cases?
Sorry I misunderstood you initially, Can we please document in readme or as a comment in the check that this check supports docker versions >= 1.18
?
I am not sure we can have a test with multiple docker versions I would need to look into that. This would be a docker in docker scenario...Minimally I need a CHANGELOG entry and ideally something documented somewhere the minimum version of docker we support.
Pull Request Checklist
Is this in reference to an existing issue? issue: https://github.com/sensu-plugins/sensu-plugins-docker/issues/45
General
[ ] Update Changelog following the conventions laid out on Keep A Changelog
[ ] Update README with any necessary configuration snippets
[ ] Binstubs are created if needed
[ ] RuboCop passes
[ ] Existing tests pass
New Plugins
[ ] Tests
[ ] Add the plugin to the README
[ ] Does it have a complete header as outlined here
Purpose
Suport docker api from version v1.18 to latest (1.29)
This fix is based on the following docker api response for [State][Running]:
https://docs.docker.com/engine/api/v1.29 section: INSPECT A CONTAINER Example response:
Known Compatablity Issues