Bug 1556782 - [3.7] Mounting file in a subpath fails if file was created in initContainer
Summary: [3.7] Mounting file in a subpath fails if file was created in initContainer
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 3.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.7.z
Assignee: Jan Safranek
QA Contact: Qin Ping
URL:
Whiteboard:
Depends On: 1555910
Blocks: 1555911
TreeView+ depends on / blocked
 
Reported: 2018-03-15 09:08 UTC by Jan Safranek
Modified: 2018-04-29 14:37 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1555910
Environment:
Last Closed: 2018-04-29 14:36:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:1231 0 None None None 2018-04-29 14:37:19 UTC

Description Jan Safranek 2018-03-15 09:08:01 UTC
+++ This bug was initially created as a clone of Bug #1555910 +++

Description of problem:

Originally reported bug : https://github.com/kubernetes/kubernetes/issues/61178

By creating a deployment where an init container creates a file in an emptydir and then the container tries to mount this file as a subpath will reproduce it.

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: subpath
  namespace: kube-system
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: subpath
    spec:
      initContainers:
        - name: init
          image: busybox
          command:
            - touch
            - /mount/test
          volumeMounts:
            - name: mount
              mountPath: /mount
      containers:
      - name: subtest
        image: busybox
        command:
          - ls
          - -l
          - /mount/test
        volumeMounts:
          - name: mount
            mountPath: /mount/test
            subPath: test
      volumes:
      - name: mount
        emptyDir: {}



--- Additional comment from Hemant Kumar on 2018-03-14 16:05:08 EDT ---

https://github.com/openshift/ose/pull/1135

Comment 1 Jan Safranek 2018-03-15 09:22:39 UTC
OSE PR: https://github.com/openshift/ose/pull/1113

Comment 3 Qin Ping 2018-04-17 07:32:37 UTC
Verified in OCP v3.7.44

Comment 8 errata-xmlrpc 2018-04-29 14:36:36 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/RHSA-2018:1231


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