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

Secrets using bind mounts #4368

Merged
merged 7 commits into from Feb 1, 2017

Conversation

Projects
None yet
2 participants
@dnephin
Copy link
Contributor

dnephin commented Jan 20, 2017

Fake secrets in docker-compose using bind mounts

See moby/moby#30144 for the feature in docker stack deploy

@shin-

This comment has been minimized.

Copy link
Contributor

shin- commented Jan 26, 2017

@dnephin Do you need help looking into those?

20:17:21 [all_py27] =================================== FAILURES ===================================

20:17:21 [all_py27] ________________ ProjectTest.test_project_up_healthy_dependency ________________

20:17:21 [all_py27] tests/integration/testcases.py:59: in wrapper

20:17:21 [all_py27]     return f(self, *args, **kwargs)

20:17:21 [all_py27] tests/integration/project_test.py:1431: in test_project_up_healthy_dependency

20:17:21 [all_py27]     config_data = build_config(config_dict)

20:17:21 [all_py27] E   TypeError: build_config() takes exactly 0 arguments (1 given)

20:17:21 [all_py27] ____________ ProjectTest.test_project_up_no_healthcheck_dependency _____________

20:17:21 [all_py27] tests/integration/testcases.py:59: in wrapper

20:17:21 [all_py27]     return f(self, *args, **kwargs)

20:17:21 [all_py27] tests/integration/project_test.py:1504: in test_project_up_no_healthcheck_dependency

20:17:21 [all_py27]     config_data = build_config(config_dict)

20:17:21 [all_py27] E   TypeError: build_config() takes exactly 0 arguments (1 given)

20:17:21 [all_py27] _______________ ProjectTest.test_project_up_unhealthy_dependency _______________

20:17:21 [all_py27] tests/integration/testcases.py:59: in wrapper

20:17:21 [all_py27]     return f(self, *args, **kwargs)

20:17:21 [all_py27] tests/integration/project_test.py:1468: in test_project_up_unhealthy_dependency

20:17:21 [all_py27]     config_data = build_config(config_dict)

20:17:21 [all_py27] E   TypeError: build_config() takes exactly 0 arguments (1 given)

20:17:21 [all_py27] ___________________ ProjectTest.test_project_up_with_secrets ___________________

20:17:21 [all_py27] tests/integration/testcases.py:59: in wrapper

20:17:21 [all_py27]     return f(self, *args, **kwargs)

20:17:21 [all_py27] tests/integration/project_test.py:1184: in test_project_up_with_secrets

20:17:21 [all_py27]     assert output == "This is the secret\n"

20:17:21 [all_py27] E   AssertionError: assert 'cat: read er...a directory\n' == 'This is the secret\n'

20:17:21 [all_py27] E     - cat: read error: Is a directory

20:17:21 [all_py27] E     + This is the secret
@dnephin

This comment has been minimized.

Copy link
Contributor Author

dnephin commented Jan 26, 2017

Oops, I didn't notice. I'll look into them

@dnephin dnephin force-pushed the dnephin:secrets-using-bind-mounts branch from 1b04217 to 1091d9d Jan 27, 2017

@dnephin

This comment has been minimized.

Copy link
Contributor Author

dnephin commented Jan 27, 2017

I fixed the TypeErrors, but the other test is passing locally.

From the failure it sounds like the file doesn't exist on the "host", so the bind mount is creating the path as a directory.

@dnephin dnephin force-pushed the dnephin:secrets-using-bind-mounts branch 3 times, most recently from ae329ee to 5b40fe8 Jan 30, 2017

@dnephin

This comment has been minimized.

Copy link
Contributor Author

dnephin commented Jan 30, 2017

ok, tests are fixed

@shin-

shin- approved these changes Jan 30, 2017

Copy link
Contributor

shin- left a comment

Just a small change, otherwise LGTM

with open(filename, 'r') as fh:
content = fh.read()

print(content)

This comment has been minimized.

@shin-

shin- Jan 30, 2017

Contributor

Remove debug statement?

This comment has been minimized.

@dnephin

dnephin Jan 31, 2017

Author Contributor

oops, removed

dnephin added some commits Dec 28, 2016

Add v3.1 with secrets.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Read service secrets as a type.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Implement secrets using bind mounts
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Add an integration test for secrets using bind mounts.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Add a warning for unsupported secret fields.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Rebase compose v3.1 on the latest v3
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Fix some test failures.
Signed-off-by: Daniel Nephin <dnephin@docker.com>

@dnephin dnephin force-pushed the dnephin:secrets-using-bind-mounts branch from 5b40fe8 to 59d1847 Jan 31, 2017

@shin- shin- merged commit c9eb938 into docker:master Feb 1, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
dco-signed All commits are signed

@dnephin dnephin deleted the dnephin:secrets-using-bind-mounts branch Feb 9, 2017

@shin- shin- referenced this pull request Feb 11, 2017

Closed

Managing secrets #1534

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