CiscoCloud / distributive

Unit testing for the cloud
Apache License 2.0
147 stars 20 forks source link

Distributive image name query does not match IMAGE name on docker ps #26

Closed LeeLammert closed 9 years ago

LeeLammert commented 9 years ago

For example:

docker ps image NAME: ciscocloud/mesos-consul

distributive query required to match that image: docker.io/ciscocloud/mesos-consul

langston-barrett commented 9 years ago

@LeeLammert Could you please add some extra information? I can't reproduce your issue with that image using either "dockerImage" or "dockerRunning". The following should help diagnose the issue:

  1. The check that you're running (JSON).
  2. The output of distributive running that test with -v=2 flag set.
  3. The commands you used to start the docker container/download the image.

Thank you!

stevendborrelli commented 9 years ago

Adding docker.io/ to a container image path is a RedHat thing. http://rhelblog.redhat.com/2015/04/15/understanding-the-changes-to-docker-search-and-docker-pull-in-red-hat-enterprise-linux-7-1/

LeeLammert commented 9 years ago

On Thu, 18 Jun 2015, Langston Barrett wrote:

@LeeLammert Could you please add some extra information? I can't reproduce your issue with that image using either "dockerImage" or "dockerRunning". The following should help diagnose the issue:

  1. The check that you're running (JSON).
  2. The output of distributive running that test with -v=2 flag set.
  3. The commands you used to start the docker container/download the image.

-bash-4.2# cat docker.json { "Name": "Docker checks (requires root permissions)", "Checklist" : [ { "Check" : "dockerImage", "Parameters" : ["docker.io/ciscocloud/mesos-consul"] }, { "Check" : "dockerRunning", "Parameters" : ["docker.io/ciscocloud/mesos-consul"] } ] }

The problem seems to be that distributive is prefixing the image name with "docker.io", whereas a "docker ps" does not show the "docker.io" prefix.

Lee
LeeLammert commented 9 years ago

More info - it appears that "docker image" and "docker running" require different name specs:

{ "Name": "Docker checks (requires root permissions)", "Checklist" : [ { "Check" : "dockerImage", "Parameters" : ["docker.io/ciscocloud/mesos-consul"] }, { "Check" : "dockerRunning", "Parameters" : ["ciscocloud/mesos-consul:v0.1.1"] } ] }

These pass.

langston-barrett commented 9 years ago

@LeeLammert Thanks! Does docker ps -a include the "docker.io" prefix?

LeeLammert commented 9 years ago

docker ps does not show the docker.io prefix, .. it is required for "dockerImage", but NOT for "dockerRunning:; in addition, "dockerRunning" requires a version, but "dockerImage" does not.

langston-barrett commented 9 years ago

@LeeLammert I am wondering specifically if there is a difference between docker ps and docker ps -a, because Distributive uses the output from docker ps -a.

LeeLammert commented 9 years ago

We could add a note to the role check file with example names, .. but the version requirement on dockerRunning troubles me - it would have to be adjusted every time an image version bumps.

langston-barrett commented 9 years ago

@LeeLammert I think you're right. The version can easily be made optional. I'll implement that.