Bug 1554670 - [3.9] subpath volume mounts do not work with secret, configmap, projected, or downwardAPI volumes
Summary: [3.9] subpath volume mounts do not work with secret, configmap, projected, or...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 3.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.9.0
Assignee: Jan Safranek
QA Contact: Jianwei Hou
URL:
Whiteboard:
Depends On:
Blocks: 1554864 1554865 1554866 1554868 1554869 1554871 1663260
TreeView+ depends on / blocked
 
Reported: 2018-03-13 06:45 UTC by Jordan Liggitt
Modified: 2019-01-03 15:12 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: OpenShift did not check correctly for parent directories when creating SubPath. Consequence: Secrets, ConfigMap, DownwardAPI and Projected volumes could not be used with SubPaths in pods. Fix: OpenShift correctly evaluates parent directories. Result: Secrets, ConfigMap, DownwardAPI and Projected volumes can be used with SubPaths in pods.
Clone Of:
: 1554864 1554865 1554866 1554868 1554869 1554871 1663260 (view as bug list)
Environment:
Last Closed: 2018-05-16 09:46:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3391931 0 None None None 2018-04-26 15:53:45 UTC

Description Jordan Liggitt 2018-03-13 06:45:28 UTC
Description of problem:

Version-Release number of selected component (if applicable):

3.9.7-1

How reproducible:

Always

Steps to Reproduce:
1. Create a pod with a secret, configmap, downwardAPI and projected volume
2. Create volume mounts for each of those volumes that make use of the subPath feature

Actual results:

The pod will not start with errors like 

failed to prepare subPath for volumeMount "config" of container "mumble": subpath "/var/lib/kubelet/pods/66fa673c-266d-11e8-8ebf-00155d00a406/volumes/kubernetes.io~configmap/config/..2018_03_13_03_19_55.572152209/mumble.ini" not within volume path "/var/lib/kubelet/pods/66fa673c-266d-11e8-8ebf-00155d00a406/volumes/kubernetes.io~configmap/config"


Expected results:

Pod starts properly and volume mounts work


Regression introduced as part of the fix for https://bugzilla.redhat.com/show_bug.cgi?id=1519365

Upstream issue: https://github.com/kubernetes/kubernetes/issues/61076#issuecomment-372554309

The security fix was backported all the way to 3.3, which means this regression was as well.

Comment 1 Jordan Liggitt 2018-03-13 13:10:27 UTC
this affects use of subPath volume mounts with any secret, configmap, projected, or downwardAPI volume

Comment 2 Jordan Liggitt 2018-03-13 13:13:45 UTC
upstream fix in https://github.com/kubernetes/kubernetes/pull/61080

Comment 3 Jan Safranek 2018-03-14 10:01:58 UTC
Origin 3.9 PR: https://github.com/openshift/origin/pull/18957

Comment 4 Jianwei Hou 2018-03-16 02:33:10 UTC
Verified this in openshift v3.9.7+d86a856. Subpath mounts work with secret, configmap, projected, or downwardAPI volumes.

Comment 8 Jan Safranek 2018-05-16 09:46:26 UTC
This bug slipped through cracks and has been fixed for a long time, at least since v3.9.16.


Note You need to log in before you can comment on or make changes to this bug.