Commit Graph

69 Commits

Author SHA1 Message Date
Daniel Portella 11b3b7cf29 provider/docker: Fixes for docker_container host object and documentation (#9367)
* Updated docker container documentation

Feedback from ticket #9350 indicated that documentation was out of date

renamed `hosts_entry` to `host`
added correct type information to *Extra Hosts* section.

Refs: 9350

* Fixes for docker_container host object

Feedback from ticket #9350 updated codebase so it reflects the requirements from docker in regards to `host` which is `Required` and not optional.
It now accurately reflects the docker requirements and the terraform documentation.

Test results

> Bear in mind the failure it is because my laptop doesnt support memory swap. So this test will always fail.

Changing the Schema from `optional` to `required` made no difference to the tests.

make testacc TEST=./builtin/providers/docker/
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/10/14 15:04:40 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/docker/ -v  -timeout 120m
=== RUN   TestAccDockerRegistryImage_basic
--- PASS: TestAccDockerRegistryImage_basic (4.57s)
=== RUN   TestAccDockerRegistryImage_private
--- PASS: TestAccDockerRegistryImage_private (6.22s)
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccDockerContainer_basic
--- PASS: TestAccDockerContainer_basic (7.16s)
=== RUN   TestAccDockerContainer_volume
--- PASS: TestAccDockerContainer_volume (7.37s)
=== RUN   TestAccDockerContainer_customized
--- FAIL: TestAccDockerContainer_customized (18.99s)
	testing.go:265: Step 0 error: Check failed: Check 2/2 error: Container has wrong memory swap setting: -1
	Please check that you machine supports memory swap (you can do that by running 'docker info' command).
=== RUN   TestAccDockerImage_basic
--- PASS: TestAccDockerImage_basic (2.58s)
=== RUN   TestAccDockerImage_private
--- PASS: TestAccDockerImage_private (2.70s)
=== RUN   TestAccDockerImage_destroy
--- PASS: TestAccDockerImage_destroy (30.00s)
=== RUN   TestAccDockerImage_data
--- PASS: TestAccDockerImage_data (5.93s)
=== RUN   TestAccDockerNetwork_basic
--- PASS: TestAccDockerNetwork_basic (0.24s)
=== RUN   TestAccDockerVolume_basic
--- PASS: TestAccDockerVolume_basic (0.05s)
FAIL
exit status 1
FAIL	github.com/hashicorp/terraform/builtin/providers/docker	85.816s
Makefile:47: recipe for target 'testacc' failed
make: *** [testacc] Error 1

Refs: 9350
2016-10-27 10:54:05 +01:00
kyhavlov 09bba0424c provider/docker: Added docker_registry_image data source (#7000) 2016-07-26 16:18:38 +01:00
JB Arsenault fc838be69e Add `destroy_grace_seconds` option to stop container before delete (#7513) 2016-07-11 16:03:02 +01:00
Daniel Portella 21618a9111 provider/docker: Docker documentation and additional test message (#7412)
* added additional error info for when memory swap assert fails.

related to https://github.com/hashicorp/terraform/pull/7392

* updated docker_container documentation

reflect recent changes to docker provider around tests, dns options and
dns search support.

* Grammar and punctuation changes

Docker container documentation.

* Spell checking, grammar and punctuation.

Docker container documentation.

* Markdown change sto docker container documentation
2016-06-29 15:48:15 +01:00
Daniel Portella b8a84691ec provider/docker: Docker DNS Setting Enhancements (#7392)
* fixed go vet issues on aws provider in  master

* added support for dns, dns options and dns search for docker container.

On docker container resource you can specify dns_opts nad dns_search
which maps directly to docker --dns_opt and --dns_search parameters.
Allowing users to setup the embedded dns settings for their containers.

* fixed the asserts for the new features in tests.

fixed tests around DNS, DNS_OPTS and DNS_SEARCH
2016-06-29 13:38:46 +01:00
stack72 8ca3d94858 provider/docker: Fixing the Docker Container Mount Test
```
make testacc TEST=./builtin/providers/docker TESTARGS='-run=TestAccDockerContainer_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/docker -v
-run=TestAccDockerContainer_ -timeout 120m
=== RUN   TestAccDockerContainer_basic
--- PASS: TestAccDockerContainer_basic (17.25s)
=== RUN   TestAccDockerContainer_volume
--- PASS: TestAccDockerContainer_volume (16.79s)
=== RUN   TestAccDockerContainer_customized
--- PASS: TestAccDockerContainer_customized (19.65s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/docker 53.712s
```
2016-06-29 09:38:56 +01:00
James Nugent 6913754191 provider/docker: don't crash with empty commands
If any of the entries in `commands` on `docker_container` resources was
empty, the assertion to string panic'd. Since we can't use ValidateFunc
on list elements, we can only really check this at apply time. If any
value is nil (resolves to empty string during conversion), we fail with
an error prior to creating the container.

Fixes #6409.
2016-04-29 18:54:45 -05:00
Xavier Sellier e4a1d21a4b Provider Docker: (#6376)
- Add option keep_locally
- Add unit test
- Add documentation
2016-04-27 17:18:02 +01:00
VERDOÏA Laurent a24207b9b7 provider/docker: #5298 Add support for docker run --user option 2016-04-04 21:43:59 -05:00
Rhyas 3926fa8092 Fix Image Destroy bug. #3609 #3771 2016-03-22 22:56:51 -06:00
Raphael Randschau f7d4aca965 Fix docker test assertions regarding latest tag 2016-03-06 16:45:06 +01:00
Verdoïa Laurent ea5f53782a provider/docker: #2417 Add support for restart policy unless-stopped 2016-02-26 12:38:31 +09:00
Colin Hebert a78d1a3cd4 Stop providing the hostConfig while starting the container 2016-02-13 22:04:51 +11:00
Paul Hinze 66ec38b2d9 Merge pull request #5046 from tpounds/use-built-in-schema-string-hash
Use built-in schema.HashString instead of custom hash functions.
2016-02-12 07:58:34 -06:00
Sebastiaan van Steenis 4a10530b07 Change default DOCKER_HOST value, fixes #4923 2016-02-10 20:21:17 +01:00
Trevor Pounds 0cd0ff0f8e Use built-in schema.HashString. 2016-02-07 16:29:34 -08:00
Colin Hebert d89c365838 remove extra parenthesis 2016-01-31 08:49:35 +11:00
Colin Hebert fd3ae2d607 Catch potential custom network errors in docker 2016-01-31 08:31:30 +11:00
James Nugent 4b7a98584a provider/docker: Mount named volumes in containers
This adds support for specifying named volumes for mounting in a
`docker_container` resource.
2016-01-15 21:59:33 +00:00
Colin Hebert e887ac2523 provider/docker: Add `docker_volume` resource 2016-01-15 17:34:53 +00:00
James Nugent 3380f08e5a provider/docker: Tweak and test `host_entry`
This adds acceptance tests for specifying extra hosts on Docker
containers. It also renames the repeating block from `hosts` to `host`,
which reads more naturally in the schema when multiple instances of the
block are declared.
2016-01-15 03:02:20 +00:00
James Nugent 35c21cb808 Merge branch 'docker-extra-hosts' of https://github.com/paulbellamy/terraform into paulbellamy-docker-extra-hosts 2016-01-14 15:48:51 +00:00
James Nugent 65b071d1af provider/docker: Fix flaky integration tests
Asserting on the value of `latest` on an image is prone to failing
because of new images being pushed upstream. Instead of asserting on a
hash, we assert that the value matches a regular expression for the
format of an image hash.
2016-01-14 09:12:05 +00:00
James Nugent ee7553f076 Merge branch 'docker_network' of https://github.com/ColinHebert/terraform into ColinHebert-docker_network 2016-01-14 07:01:03 +00:00
Colin Hebert f72322ca33 Add Elem and Set to the network set 2016-01-05 03:46:24 +01:00
Colin Hebert 35188f3694 Fix typo 2016-01-04 21:03:53 +01:00
Colin Hebert 6e36095644 Add the networks entry 2016-01-04 20:58:54 +01:00
Colin Hebert f09280891c Add support of custom networks in docker 2016-01-02 12:20:55 +01:00
Colin Hebert ad0a763661 Convert v to string 2016-01-01 10:12:43 +01:00
Colin Hebert 32ce8fbcb4 Add network_mode support to docker 2016-01-01 09:57:21 +01:00
stack72 5fbec544d7 Fixing yet more gofmt errors with imports 2015-12-21 09:54:24 +00:00
Paul Bellamy 52d178b7ac provider/docker: Inline ports and volumes schemas for consistency 2015-12-03 10:51:59 +00:00
Paul Bellamy 7a24764c15 provider/docker: Add hosts parameter for containers 2015-12-03 10:32:41 +00:00
James Nugent 597fafbb68 provider/docker: locate container via ID not name
This reapplies the patch mentioned in #3364 - for an unknown reason the
diff there was incorrect.
2015-12-02 17:27:24 -05:00
James Nugent 4ce6455e8a provider/docker: Refer to a tag instead of latest
This should make tests more stable going forward. Also switch out the
image used from Ubuntu to Alpine Linux to reduce required download size
during test runs.
2015-12-02 15:08:16 -05:00
James Nugent 50d7abcd8a Merge pull request #3761 from ryane/f-provider-docker-improvements
provider/docker: support additional arguments for `docker_container` resource
2015-12-02 11:46:29 -05:00
Paul Hinze e67551a641 provider/docker: fix image test
there's a new latest in town
2015-11-20 09:58:03 -06:00
ryane 4fc60c9f89 docker: improve validation of runtime constraints 2015-11-09 19:36:23 -05:00
ryane b5ae355a99 include hostconfig when creating docker_container 2015-11-04 15:52:16 -05:00
ryane 1f739d31da fix resource constraint specs 2015-11-04 15:52:16 -05:00
ryane 72c86a62c0 support for log driver + config in docker container 2015-11-04 15:52:16 -05:00
ryane 4531866d8d add label support to docker container resource 2015-11-04 15:52:15 -05:00
ryane 6842c32d03 add basic runtime constraints to docker_container 2015-11-04 15:52:15 -05:00
ryane 17d185808e restart policy support for docker_container 2015-11-04 15:52:15 -05:00
ryane 0ded14f160 entrypoint support for docker_container resource 2015-11-04 15:52:15 -05:00
Panagiotis Moustafellos e4845f75cc removed extra parentheses 2015-10-08 15:48:04 +03:00
stack72 4cf9c64de0 Gofmt change for resource docker_image test 2015-10-08 09:47:50 +01:00
Matti Savolainen 09e336a80a Fix Repository attribute in docker client PullOptions for private registries. 2015-07-03 12:58:05 +03:00
Paul Hinze 4981d7d28c provider/docker: [tests] change images
use a base image with a long running process - fixes container tests
2015-06-29 16:09:05 -05:00
Jeff Mitchell edbc578316 As discussed on the issue, remove the hard-coded delay on startup in
favor of attempting to detect if the initial container ever enters
running state, and erroring out if not. It will re-check the container
once every 500ms for 15 seconds total; future work could make that
configurable.
2015-06-25 15:11:00 +00:00