• 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
..
aws_ebs Loading commit data...
azure_file Loading commit data...
cephfs Loading commit data...
cinder Loading commit data...
configmap Loading commit data...
downwardapi Loading commit data...
empty_dir Loading commit data...
fc Loading commit data...
flexvolume Loading commit data...
flocker Loading commit data...
gce_pd Loading commit data...
git_repo Loading commit data...
glusterfs Loading commit data...
host_path Loading commit data...
iscsi Loading commit data...
nfs Loading commit data...
persistent_claim Loading commit data...
rbd Loading commit data...
secret Loading commit data...
testing Loading commit data...
util Loading commit data...
OWNERS Loading commit data...
doc.go Loading commit data...
metrics_cached.go Loading commit data...
metrics_du.go Loading commit data...
metrics_du_test.go Loading commit data...
metrics_nil.go Loading commit data...
metrics_nil_test.go Loading commit data...
plugins.go Loading commit data...
plugins_test.go Loading commit data...
util.go Loading commit data...
util_test.go Loading commit data...
volume.go Loading commit data...
volume_linux.go Loading commit data...
volume_unsupported.go Loading commit data...