-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Extend secrets volumes with path control #25285
Extend secrets volumes with path control #25285
Conversation
@bgrant0607 for API review |
payload := make(map[string][]byte, len(secret.Data)) | ||
|
||
if len(mappings) == 0 { | ||
for name, data := range secret.Data { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I frequently wish that go allowed interface specifications to contain fields or had a mixin mechanism that allow type-unspecific use of fields with a specific type signature.
@ingvagabund looks great so far, will you add an e2e as well? |
@ingvagabund also, doc changes to kubernetes.github.io in a follow-up PR in that project. |
Docs updated kubernetes/website#478 |
f6261da
to
5da56d6
Compare
File permissions are changing as well:
Additional data: ls -ld /etc/foo/
drwxrwxrwt. 4 root root 100 May 11 12:35 /etc/foo/
ls -ld /etc/foo/path
drwxr-xr-x. 2 root root 60 May 11 12:35 /etc/foo/path
ls -ld /etc/foo/path/my-username
lrwxrwxrwx. 1 root root 26 May 11 12:35 /etc/foo/path/my-username -> ../..data/path/my-username
ls -ld /etc/foo/..data/path/my-username
-rw-r--r--. 1 root root 8 May 11 12:35 /etc/foo/..data/path/my-username
ls -ld /etc/foo/..5985_11_05_12_35_30.806564262/path/
drwxr-xr-x. 2 root root 60 May 11 12:35 /etc/foo/..5985_11_05_12_35_30.806564262/path/
ls -ld /etc/foo/..5985_11_05_12_35_30.806564262/path/my-username
-rw-r--r--. 1 root root 8 May 11 12:35 /etc/foo/..5985_11_05_12_35_30.806564262/path/my-username Still confused as both
|
I'm fine with this change. It's consistent with ConfigMapVolumeSource. |
Updated e2e tests for |
Wrt. to the permissions:
[1] http://stackoverflow.com/questions/7487793/symbolic-link-not-inheriting-permissions |
95c570d
to
4d60c06
Compare
… to path mapping. The key to path mapping allows pod to specify different name (thus location) of each secret. At the same time refactor the volume plugin to use AtomicWritter to project secrets to files in a volume. Update e2e Secrets test, the secret file permission has changed from 0444 to 0644 Remove TestPluginIdempotent as the AtomicWritter is responsible for secret creation
4d60c06
to
e3aa900
Compare
@ingvagabund now that #25800 has merged, do you need to update this PR? |
@pmorie the PR can be merged as it is |
@ingvagabund thanks a lot for the fix |
GCE e2e build/test passed for commit e3aa900. |
Automatic merge from submit-queue |
As per [1] this PR extends secrets mapped into volume with:
Here the
spec.volumes[0].secret.items
added changing original target/etc/foo/username
to/etc/foo/my-username
.pkg/volumes/secrets/secrets.go
volume plugin to useAtomicWritter
to project a secret into file.[1] https://github.com/kubernetes/kubernetes/blob/master/docs/design/configmap.md#changes-to-secret