• k8s-merge-robot's avatar
    Merge pull request #25285 from ingvagabund/extend-secrets-volumes-with-path-control · eb733cbf
    k8s-merge-robot authored
    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
    eb733cbf
Name
Last commit
Last update
.github Loading commit data...
Godeps Loading commit data...
api/swagger-spec Loading commit data...
build Loading commit data...
cluster Loading commit data...
cmd Loading commit data...
contrib Loading commit data...
docs Loading commit data...
examples Loading commit data...
federation Loading commit data...
hack Loading commit data...
hooks Loading commit data...
logo Loading commit data...
pkg Loading commit data...
plugin Loading commit data...
release Loading commit data...
test Loading commit data...
third_party Loading commit data...
vendor Loading commit data...
www Loading commit data...
.generated_docs Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CHANGELOG.md Loading commit data...
CONTRIB.md Loading commit data...
CONTRIBUTING.md Loading commit data...
DESIGN.md Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
Vagrantfile Loading commit data...
code-of-conduct.md Loading commit data...