Skip to content

Docker 1.8 support - #540

Merged
mizzy merged 3 commits into
mizzy:masterfrom
DarrellMozingo:docker_1.8
Oct 28, 2015
Merged

Docker 1.8 support#540
mizzy merged 3 commits into
mizzy:masterfrom
DarrellMozingo:docker_1.8

Conversation

@DarrellMozingo

Copy link
Copy Markdown
Contributor

Docker 1.8 changed the format of the json response of docker inspect starting in 1.8, specifically relating to volumes.

Doing a check for the new node and asserting against that for the has_volume? matcher, falling back to pre 1.8 if it's not found.

Copied original spec to keep all pre 1.8 tests even though most won't be affected by this.
Doing a search of all 'Mounts' nodes from the inspect output for the given arguments.

@mizzy suggested doing the fall-through inline instead of making it more complicated.
Comment thread lib/serverspec/type/docker_container.rb Outdated

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is not needed bacuse private was called already.

@DarrellMozingo

Copy link
Copy Markdown
Contributor Author

Fixed the extra private. Did't know if you'd rather be more explicit

@mizzy

mizzy commented Oct 28, 2015

Copy link
Copy Markdown
Owner

Thanks!

mizzy added a commit that referenced this pull request Oct 28, 2015
@mizzy
mizzy merged commit e0e078b into mizzy:master Oct 28, 2015
@mizzy

mizzy commented Oct 28, 2015

Copy link
Copy Markdown
Owner

Released as v2.24.2.

@rebyn

rebyn commented Nov 5, 2015

Copy link
Copy Markdown

Hi,

am thinking about adding more Docker matchers to serverspec, ie:

  • port mapping
  • links
  • restart policy
  • env variables

Want to ask for your thoughts before moving on, since I can see Docker support has been added a while ago but the number of matchers is limited. Is there a reason to that?

Cheers,
Tu.

@mizzy

mizzy commented Nov 5, 2015

Copy link
Copy Markdown
Owner

We can access all attributes of docker inspect like this.

describe docker_container('foo') do
  its(['HostConfig.RestartPolicy.MaximumRetryCount']) { should == 0 }
end

I think we should use this syntax as much as possible.

But if you think it's hard to write or hard to read about some attributes, then think about adding matchers.

@rebyn

rebyn commented Nov 5, 2015

Copy link
Copy Markdown

👍 yup, I guess that'll do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants