FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

The implicit `:Z` flag on docker mount prevents use of podman on some drivers · Issue #2560 · pre-commit/pre-commit · GitHub

Repository navigation

The implicit :Z flag on docker mount prevents use of podman on some drivers  #2560

Closed

Description

search you tried in the issue tracker

yes, lsetxattr search did not bring any results

describe your issue

On a Fedora 36 VM with podman and running pre-commit against a folder mounted using parallels from macos, it not possible to use pre-commit because the mount fails:

ShellCheck v0.8.0........................................................Failed
- hook id: shellcheck
- duration: 0.48s
- exit code: 126

Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: lsetxattr /media/psf/c/a/creator-ee/.cache: operation not supported
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: lsetxattr /media/psf/c/a/creator-ee/.cache: operation not supported

This is happening because macos filesystem does not allow extended attributes, so podman will not be able to call lsetxattr. If the :Z would be omitted when running the container engine, the issue would not appear.

pre-commit --version

2.20.2

.pre-commit-config.yaml

repos:
  - repo: https://github.com/koalaman/shellcheck-precommit
    rev: v0.8.0
    hooks:
      - id: shellcheck
        verbose: true
        args:
          - --color=always

~/.cache/pre-commit/pre-commit.log (if present)

N/A

Other

I would be happy to contribute a fix for this but I should probably wait for some feedback regarding the direction in which this should go, especially as you will want to minimize the impact on current users.

I guess that testing if extended attributes on current directory are working should not be too hard and if this fails, we could avoid adding the :Z to the volume mounts. This should minimize the behavior change IMHO.

Activity

  1. asottile commented on Oct 26, 2022

    Member

    didn't think to search "docker Z" ? duplicate: #2509

    I'd recommend using shellcheck-py instead -- it installs natively and generally fits better with the framework

  2. ssbarnea commented on Oct 26, 2022

    Author

    I will try using shellcheck-py, not sure why I did not pick it at that time, probably I will find-out soon.

    FYI, I already started with podman team on making some changes to improve the podman experience and I have a PR related to this podman-container-tools/podman#16261 but I have the impression that we will not be able to address an explicitly added :Z even when that PR will merge. What made me raise the linked PR on podman was bit different and was related to podman-machine on macos (the vm that is installed by podman on mac). On Fedora VM, the situation is different. Still, both issues are related to drive mounts that do not support extended attributes and selinux.

    I am wondering why a linter would need to make use of extended attribute volume mounts? Some might even say that the mounts could be ro if they don't want to use auto-fix ability.

  3. asottile commented on Oct 26, 2022

    Member

    you're free to git blame and find out the reason it was changed to include :Z

  4. ssbarnea commented on Oct 26, 2022

    Author

    It did not take me long to find why I did not use the wheel. It does not come with arm64 build, but the container does, and that is not something to be ignored.

  5. asottile commented on Oct 26, 2022

    Member

    there's no wheel involved either way so that's not relevant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL