Bug 1451008 - Pods fail to start if they specify a file as a volume subPath to mount
Summary: Pods fail to start if they specify a file as a volume subPath to mount
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 3.6.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Matthew Wong
QA Contact: Wenqi He
URL:
Whiteboard:
Depends On: 1451007
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-15 14:44 UTC by Matthew Wong
Modified: 2017-08-16 19:51 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1451007
Environment:
Last Closed: 2017-08-10 05:24:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1716 0 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.6 RPM Release Advisory 2017-08-10 09:02:50 UTC

Description Matthew Wong 2017-05-15 14:44:43 UTC
+++ This bug was initially created as a clone of Bug #1451007 +++

Description of problem:

Pods fail to start if they specify a file as a volume subPath to mount

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

How reproducible:

Always

Steps to Reproduce:
1. Create a pod that mounts a volume's file using subPath

Actual results:

Pod reports "mkdir" error and fails to start

Expected results:

Pod enters Running state

--- Additional comment from Matthew Wong on 2017-05-15 10:44:19 EDT ---

https://github.com/openshift/origin/pull/14193

Comment 1 Matthew Wong 2017-06-01 13:28:49 UTC
PR: https://github.com/openshift/origin/pull/14193

Comment 3 Wenqi He 2017-06-13 07:36:43 UTC
Tested on below version:
openshift v3.6.105
kubernetes v1.6.1+5115d708d7

The pod could be started with subpath:
$ cat pod.json
{
    "apiVersion": "v1",
    "kind": "Pod",
    "metadata": {
        "name": "mypod1",
        "labels": {
            "name": "frontendhttp"
        }
    },
    "spec": {
        "containers": [{
            "name": "myfrontend",
            "image": "jhou/hello-openshift",
            "imagePullPolicy": "IfNotPresent",
            "ports": [{
                "containerPort": 80,
                "name": "http-server"
            }],
            "volumeMounts": [{
                "mountPath": "/opt/wehe",
                "subPath": "wehe",
                "name": "pvol"
            }]
        }],
        "volumes": [{
            "name": "pvol",
            "nfs": {
                "server": "XXX",
                "path": "/",
                "readOnly": false
            }
        }]
    }
}

$ oc get pods
mypod1       1/1       Running   0          1m

[root@mypod1 opt]# ll
total 0
drwxrwxrwx. 2 root root 6 Jun 13 07:31 wehe

Comment 5 errata-xmlrpc 2017-08-10 05:24:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1716


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