mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-04-26 00:29:44 -04:00
Automatic merge from submit-queue
Extend secrets volumes with path control
As per [1] this PR extends secrets mapped into volume with:
* key-to-path mapping the same way as is for configmap. E.g.
```
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"name": "mypod",
"namespace": "default"
},
"spec": {
"containers": [{
"name": "mypod",
"image": "redis",
"volumeMounts": [{
"name": "foo",
"mountPath": "/etc/foo",
"readOnly": true
}]
}],
"volumes": [{
"name": "foo",
"secret": {
"secretName": "mysecret",
"items": [{
"key": "username",
"path": "my-username"
}]
}
}]
}
}
```
Here the ``spec.volumes[0].secret.items`` added changing original target ``/etc/foo/username`` to ``/etc/foo/my-username``.
* secondly, refactoring ``pkg/volumes/secrets/secrets.go`` volume plugin to use ``AtomicWritter`` to project a secret into file.
[1] https://github.com/kubernetes/kubernetes/blob/master/docs/design/configmap.md#changes-to-secret
|
||
|---|---|---|
| .. | ||
| admission | ||
| api | ||
| apimachinery | ||
| apis | ||
| apiserver | ||
| auth | ||
| capabilities | ||
| client | ||
| cloudprovider | ||
| controller | ||
| conversion | ||
| credentialprovider | ||
| fieldpath | ||
| fields | ||
| genericapiserver | ||
| healthz | ||
| httplog | ||
| hyperkube | ||
| kubectl | ||
| kubelet | ||
| kubemark | ||
| labels | ||
| master | ||
| metrics | ||
| probe | ||
| proxy | ||
| quota | ||
| registry | ||
| runtime | ||
| security | ||
| securitycontext | ||
| serviceaccount | ||
| ssh | ||
| storage | ||
| types | ||
| ui | ||
| util | ||
| version | ||
| volume | ||
| watch | ||
| OWNERS | ||