Skip to content

Skip bind mounts - #7

Open
GPla wants to merge 1 commit into
PLCnext:mainfrom
GPla:patch-1
Open

Skip bind mounts#7
GPla wants to merge 1 commit into
PLCnext:mainfrom
GPla:patch-1

Conversation

@GPla

@GPla GPla commented Sep 2, 2026

Copy link
Copy Markdown

The script changes the permissions for the named volumes like projects, logs etc.
It fails for user-added bind mounts ,e.g,

volumes:
  - ./some_folder:/opt/plcnext/some_folder

This change skips volumes without a name (other types of mounts).

Alternatively, one could check the type of mount and apply ACLs to the bind mount if so desired:

volumes=$(podman inspect $container_id --format '{{ range .Mounts }}{{.Type}}:{{ .Name }}:{{ .Source }}:{{ .Destination }} {{ end }}')

IFS=':' read -r volume_type volume_name volume_source container_path <<< "$volume"

if [ "$type" = "volume" ]; then
    volume_mnt=$(podman volume mount $volume_name)
elif [ "$type" = "bind" ]; then
    continue # or volume_mnt="$volume_source"
else
    continue
fi

Added a check to skip processing if the volume name is empty.
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

Successfully merging this pull request may close these issues.

1 participant