Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-4082

Mounting a configmap into a devworkspace messes up folder permissions

XMLWordPrintable

    • False
    • None
    • False

      Description of problem:

      Mounting a configmap into a user folder causes the permissions to change to `root`

      usual folder permissions:

      lombok-project-sample $ ls -la ~/.m2
      total 4
      drwxrwsr-x. 2 root user 4096 Mar  2 14:51 .
      drwxrwxr-x. 1 root root   45 Mar  2 14:52 ..
      

      folder permissions after mounting a file:

      lombok-project-sample $ ls -la ~/.m2
      total 4
      drwxr-xr-x. 2 root root   26 Mar  2 14:42 .
      drwxrwxr-x. 1 root root  110 Mar  2 14:43 ..
      -rw-r-----. 1 root user 2778 Mar  2 14:42 settings.xml
      

      configmap set-up:

        labels:
          controller.devfile.io/mount-to-devworkspace: 'true'
          controller.devfile.io/watch-configmap: 'true'
        annotations:
          controller.devfile.io/mount-as: subpath
          controller.devfile.io/mount-path: /home/user/.m2
      

      official documentation for mounting configmaps:
      https://github.com/devfile/devworkspace-operator/blob/main/docs/additional-configuration.adoc#automatically-mounting-volumes-configmaps-and-secrets

      These permission changes are a major blocker for the usability of the disconnected cluster samples causing the maven commands to fail for example:

      ...
      [DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
      [DEBUG] Reading user settings from /home/user/.m2/settings.xml
      [DEBUG] Reading global toolchains from /usr/share/maven/conf/toolchains.xml
      [DEBUG] Reading user toolchains from /home/user/.m2/toolchains.xml
      [DEBUG] Using local repository at /home/user/.m2/repository
      [ERROR] Could not create local repository at /home/user/.m2/repository -> [Help 1]
      org.apache.maven.repository.LocalRepositoryNotAccessibleException: Could not create local repository at /home/user/.m2/repository
      

      Prerequisites (if any, like setup, operators/versions):

      • brew.registry.redhat.io/rh-osbs/iib:444876
      • brew.registry.redhat.io/rh-osbs/iib:440880
      • CRW 3.5.0GA
      • DWO 0.19
      • Disconnected cluster
      • configmap mounted to a folder that's important for the function of the toolchain in the workspace

      Steps to Reproduce

      1. mount a configmap into a folder that's important for the function of the toolchain
      2. trigger a build with debugging

      Actual results:

      Build fails because toolchain cannot modify the folder

      Expected results:

      The folder the configmap file was mounted into keeps the original permissions

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Build Details:

      Dashboard Version
      7.60.2
      Server Version
      3.5 @ fa71a #7 :: Eclipse Che Dashboard 7.60.1 @ 5529

      Additional info (Such as Logs, Screenshots, etc):

              dnochevn Dmytro Nochevnov
              tdancs Tibor Dancs (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: