Skip to content

[dmt] fix mount points rules#420

Draft
diyliv wants to merge 4 commits into
mainfrom
fix/mount-points-exclusions-and-files
Draft

[dmt] fix mount points rules#420
diyliv wants to merge 4 commits into
mainfrom
fix/mount-points-exclusions-and-files

Conversation

@diyliv

@diyliv diyliv commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Built-in exclusions for system paths: /sys, /dev, /proc are now ignored by both container and templates mount-points rules. CSI drivers commonly mount these host paths at runtime without declaring them in Helm templates.
  • Add files: support to templates rule: mountPointsFile struct now parses files: alongside dirs:, matching the container rule behaviour.
  • Fix filepath.Walk error handling: return err changed to return nil + error reporting — a single permission error no longer stops the entire tree walk, which would skip all mount-points.yaml files below the problematic directory.
  • Add error logging to container rule: collectMountPointsDirs now logs walk/read/parse errors via log.Warn instead of silently swallowing them.

Context

The csi-netapp module CI was failing with many false warnings from the templates rule:

mount-points.yaml references dir "/dev" which is not used as a mountPath in any pod controller
mount-points.yaml references dir "/etc/iscsi" which is not used as a mountPath in any pod controller
mount-points.yaml references dir "/host" which is not used as a mountPath in any pod controller
...

These are host system paths that the CSI driver accesses at runtime — they are correct but absent from Helm templates. The /sys path was explicitly requested to be excluded. The files: entries in mount-points.yaml were silently ignored by the templates rule. And the container rule swallowed all read/parse errors, making bugs invisible.

Example

Before (CI output for csi-netapp):

mount-points (#templates): mount-points.yaml references dir "/dev" which is not used as a mountPath in any pod controller
mount-points (#templates): mount-points.yaml references dir "/etc/iscsi" which is not used as a mountPath in any pod controller
mount-points (#templates): mount-points.yaml references dir "/host" which is not used as a mountPath in any pod controller

After: /dev is skipped as a built-in system path. Remaining module-specific paths (/host, /etc/iscsi, /etc/multipath, etc.) can be excluded via module config:

templates:
  excludeRules:
    mount-points:
      - /host
      - /etc/multipath
      - /etc/iscsi
      - /run/iscsid
      - /run/multipathd
      - /var/lib/iscsi
      - /var/lib/kubelet
      - /var/lib/trident/tracking
      - /certs
      - /csi

Signed-off-by: diyliv <onlogn081@gmail.com>
@diyliv diyliv changed the title fix mount points rules [dmt] fix mount points rules Jul 9, 2026
@diyliv diyliv self-assigned this Jul 9, 2026
@diyliv diyliv added bug Something isn't working go Pull requests that update go code labels Jul 9, 2026
@diyliv diyliv marked this pull request as draft July 9, 2026 09:24
@diyliv diyliv requested a review from ldmonster July 9, 2026 09:24
Signed-off-by: diyliv <onlogn081@gmail.com>
@diyliv diyliv marked this pull request as ready for review July 9, 2026 12:24
@diyliv diyliv marked this pull request as draft July 9, 2026 18:48
diyliv added 2 commits July 9, 2026 21:54
Signed-off-by: diyliv <onlogn081@gmail.com>
Signed-off-by: diyliv <onlogn081@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant