To Reproduce
The issue with the snippet above is a trailing space on the second path entry: /etc/kubernetes.
PERSISTENT_STATE_BIND also has to be set, this can only be reproduced in bind mode.
It will result in an empty mount:
Mar 27 16:14:24 host-1 elemental[888]: Persistent: types.PersistentMounts{
Mar 27 16:14:24 host-1 elemental[888]: Mode: "bind",
Mar 27 16:14:24 host-1 elemental[888]: Paths: []string{
Mar 27 16:14:24 host-1 elemental[888]: "",
Mar 27 16:14:24 host-1 elemental[888]: "/etc/systemd",
Mar 27 16:14:24 host-1 elemental[888]: "/etc/rancher",
.
.
Ultimately this will lead to all paths mounted in read only:
/dev/vda5 on /etc/kubernetes type ext4 (ro,relatime)
/dev/vda5 on /etc/systemd type ext4 (ro,relatime)
/dev/vda5 on /etc/rancher type ext4 (ro,relatime)
Expected behavior
Trimming the blank entry should be a safe behavior. It would be also best to print a warning so that the user can fix the typo eventually.
elemental-toolkit version:
v2.0.0
Describe the bug The persistent paths defined in mount-layout are all mounted read-only:
To Reproduce The issue with the snippet above is a trailing space on the second path entry:
/etc/kubernetes
.PERSISTENT_STATE_BIND
also has to be set, this can only be reproduced in bind mode. It will result in an empty mount:Ultimately this will lead to all paths mounted in read only:
Expected behavior Trimming the blank entry should be a safe behavior. It would be also best to print a warning so that the user can fix the typo eventually.