sincecutoff.com
← all changes

helmfile `dir=` selector filters releases and skips sub-helmfile traversal

Introduced 2026-10-16 · score 0.97

HOW TO USE IT

When syncing a service in nested Helmfiles, run `helmfile -l dir=<path> sync` to select releases whose defining Helmfile is in that directory or a subdirectory; Helmfile skips sub-Helmfile branches whose location rules out a match.

helmfile -l dir=apps/<single-service> sync

WHY THIS HELPS

When syncing one service in a project with nested helmfiles, select its directory to filter releases and skip sub-helmfile branches that cannot match.

BEFORE THIS CHANGE

Before this change, CLI selectors could skip a nested Helmfile before loading or rendering it only when that entry had explicit `selectors:` provably incompatible with the CLI selectors; otherwise the nested branches were parsed and templated before release filtering.

REQUIREMENTS AND LIMITATIONS

  • Version: v1.8.2
  • -l, --selector <key=value>: Select releases matching labels; `dir=<path>` uses the defining Helmfile's directory relative to the root and matches that directory and its subdirectories. The option can be specified multiple times; comma-separated selectors in a group are all required, while separate groups are resolved independently.
  • dir=<path> (required): For this task, provide a relative directory path. Trailing slashes and `./` prefixes are stripped. Absolute paths, escaping `..` segments, and bare `.` are rejected. `dir` is reserved; user-defined `dir` labels are ignored for selector matching and cause a warning.
  • Prerequisite: Helmfile v1.8.2 documentation describes this selector. Helm must be installed for Helmfile operation.
  • Directory matching is relative to the root directory: the file passed via `-f` (or that directory itself when `-f` points to one), or the current directory when no `-f` is given.
  • `dir=` uses directory-prefix matching, so a path matches releases in that directory and its subdirectories.
  • Values are normalized by stripping trailing slashes and `./` prefixes.
  • Absolute paths, `..` segments that escape the root, and bare `.` are rejected at parse time; omit the selector to match every release.
  • The `dir` label key is reserved; user-defined `dir` labels are ignored for selector matching and produce a warning.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card