Skip to content

editflags: --mount: .mounts |= unique_by(.location) seems incorrect #3959

@AkihiroSuda

Description

@AkihiroSuda

I know this is just existing code that is being moved, but the logic is incorrect: the mounts need to be unique by .mountPoint, not by .location. The same location can be mounted to several mount points, and this logic would delete all but one of them.

But the mount point may only be filled in later (defaults to location), so we can't do anything here beyond making sure that the new mount points are defined first, so they will overrride existing mounts (mostly relevant only for the writable property).

I think this would be better (but have not tested it):

				// mount options take precedence over template settings
				expr := fmt.Sprintf(".mounts = %s + .mounts", mountListExpr)

Could also open a new issue to address later.

Originally posted by @jandubois in #3947 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/clilimactl CLI user experiencebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions