Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mounting files that conflict with stow directory files causes persistent home to not work #1257

Closed
dkwon17 opened this issue Apr 23, 2024 · 0 comments
Assignees
Milestone

Comments

@dkwon17
Copy link
Collaborator

dkwon17 commented Apr 23, 2024

Description

Mounting files via configmap, secret or PVC that conflict with stow directory files, this causes the stow command to fail when running persistentUserHome in the DWOC is enabled.

How To Reproduce

  1. Create a configmap that creates a file that conflicts with a file in the /home/tooling directory of the UDI image, such as /home/user/.config/containers/storage.conf:
kind: ConfigMap
apiVersion: v1
metadata:
  name: fuse-overlay
  labels:
    controller.devfile.io/mount-to-devworkspace: 'true'
    controller.devfile.io/watch-configmap: 'true'
  annotations:
    controller.devfile.io/mount-as: file
    controller.devfile.io/mount-path: /home/user/.config/containers
data:
  storage.conf: |
    [storage]
    driver = "overlay"

    [storage.options.overlay]
    mount_program="/usr/bin/fuse-overlayfs"
  1. Enable persistUserHome in the DWOC:
apiVersion: controller.devfile.io/v1alpha1
config:
  workspace:
    persistUserHome:
      enabled: true
  1. Create this DevWorkspace:
kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: plain-devworkspace
spec:
  started: true
  routingClass: 'basic'
  template:
    attributes:
      controller.devfile.io/storage-type: per-workspace
    components:
      - name: udi
        container:
          image: quay.io/devfile/universal-developer-image:ubi8-latest
  1. When the workspace is running, run the following command in the udi container to verify that the stow command in the UDI's entrypoint did not succeed:
$ cat /tmp/stow.log | tail -n 10
LINK: .sdkman/var/delay_upgrade => ../../../tooling/.sdkman/var/delay_upgrade
MKDIR: .sdkman/var/metadata
LINK: .sdkman/var/platform => ../../../tooling/.sdkman/var/platform
LINK: .sdkman/var/version => ../../../tooling/.sdkman/var/version
LINK: .sdkman/var/version_native => ../../../tooling/.sdkman/var/version_native
LINK: .gitconfig => ../tooling/.gitconfig
Planning stow of package .... done
WARNING! stowing . would cause conflicts:
  * existing target is not owned by stow: .config/containers/storage.conf
All operations aborted.

Expected behavior

It would be great if the stow command should succeed

Additional context

@dkwon17 dkwon17 changed the title Mounting files that conflict with stow directory files causes persistent home to not work as expected Mounting files that conflict with stow directory files causes persistent home to not work Jun 4, 2024
dkwon17 added a commit to dkwon17/devworkspace-operator that referenced this issue Jun 21, 2024
…tainer if persistent home is enabled

Fix devfile#1257

Disabling automount resources for the init-persistent-home initconatiner
is done to avoid possible stow conflicts which can be introduced by
automount resources.
dkwon17 added a commit to dkwon17/devworkspace-operator that referenced this issue Jun 21, 2024
…tainer if persistent home is enabled

Fix devfile#1257

Disabling automount resources for the init-persistent-home initconatiner
is done to avoid possible stow conflicts which can be introduced by
automount resources.

Signed-off-by: David Kwon <dakwon@redhat.com>
@dkwon17 dkwon17 added this to the v0.29.x milestone Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant