Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'init' option to docker_container module to support docker's --init option #34547

Merged

Conversation

suzuki-shunsuke
Copy link
Contributor

SUMMARY

Add 'init' option to docker_container module to support docker's --init option.
This option requires Docker API 1.25+.

Fixes #30761

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

docker_container module's init option

ANSIBLE VERSION
v2.4

@ansibot
Copy link
Contributor

ansibot commented Jan 7, 2018

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 cloud community_review In order to be merged, this PR must follow the community review workflow. docker feature_pull_request module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. labels Jan 7, 2018
@ansibot
Copy link
Contributor

ansibot commented Jan 7, 2018

The test ansible-test sanity --test validate-modules [?] failed with the following error:

lib/ansible/modules/cloud/docker/docker_container.py:0:0: E309 version_added for new option (init) should be 2.5. Currently 0.0

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Jan 7, 2018
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Jan 11, 2018
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jan 11, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jan 19, 2018
@ansibot ansibot added the new_contributor This PR is the first contribution by a new community member. label Jan 27, 2018
@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_pull_request labels Mar 2, 2018
@Akasurde
Copy link
Member

@suzuki-shunsuke Could you please rebase this branch ?

@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Mar 16, 2018
@suzuki-shunsuke suzuki-shunsuke force-pushed the add_docker_container_init_option branch from 87f682d to 65fa562 Compare March 16, 2018 12:51
@ansibot ansibot removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Mar 16, 2018
@suzuki-shunsuke suzuki-shunsuke force-pushed the add_docker_container_init_option branch from 65fa562 to 100f3db Compare March 16, 2018 14:00
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Mar 16, 2018
@suzuki-shunsuke
Copy link
Contributor Author

@Akasurde
I have rebased this branch.

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Mar 16, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 24, 2018
init:
description:
- Run an init inside the container that forwards signals and reaps processes.
This option requires Docker API 1.25+.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please provide input sanity checking against the docker API version so that if an user attempts to use init and doesn't have a new enough version of the API, they don't get a stack trace but instead a proper ansible fail_json message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@maxamillion
Thank you for your review.
I have added the validation of docker API's version.

Copy link
Contributor

Choose a reason for hiding this comment

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

@maxamillion @suzuki-shunsuke The validation check wasn't enough, as init is still passed on, which leads to an error (see #42162).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@felixfontein
Oh, I'm sorry.
I understand what is wrong by seeing #42162 (comment) .

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed community_review In order to be merged, this PR must follow the community review workflow. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels May 24, 2018
@ansibot
Copy link
Contributor

ansibot commented May 24, 2018

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/cloud/docker/docker_container.py:0:0: E325 argument_spec for "init" defines type="bool" but documentation does not

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels May 24, 2018
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels May 24, 2018
@maxamillion maxamillion merged commit 38c86b7 into ansible:devel May 24, 2018
gothicx pushed a commit to gothicx/ansible that referenced this pull request Jun 9, 2018
…nit` option (ansible#34547)

* Add support for `--init` option to `docker_container` module

Fixes ansible#30761

* Validate docker API's version when docker_container's init option is True

ansible#34547 (review)
https://docs.docker.com/engine/reference/commandline/run/#options

init option requires docker API 1.25+ .

* Fix failure of sanity test
jacum pushed a commit to jacum/ansible that referenced this pull request Jun 26, 2018
…nit` option (ansible#34547)

* Add support for `--init` option to `docker_container` module

Fixes ansible#30761

* Validate docker API's version when docker_container's init option is True

ansible#34547 (review)
https://docs.docker.com/engine/reference/commandline/run/#options

init option requires docker API 1.25+ .

* Fix failure of sanity test
@ansible ansible locked and limited conversation to collaborators May 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 cloud core_review In order to be merged, this PR must follow the core review workflow. docker feature This issue/PR relates to a feature request. module This issue/PR relates to a module. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker_container: Add support for --init option
6 participants