Skip to content

Use consistent, documented delimiters for includeTags regex lists #1838

Description

@mikegleasonjr

Problem

includeTags is a list of regular expressions, but the delimiter depends on how it is configured:

  • DIUN_DEFAULTS_INCLUDETAGS is decoded as a slice and uses commas as separators.
  • diun.include_tags Docker labels use semicolons as separators.

This is easy to miss and creates a regex-specific trap. A valid regex such as:

^(?:\\d+\\.){2,}\\d+-alpine$

contains a comma in {2,}. It works in diun.include_tags, but the same expression breaks through DIUN_DEFAULTS_INCLUDETAGS, because the comma is interpreted as a list separator.

Why this is confusing

The two configuration paths represent the same setting but use different delimiters, and the environment-variable delimiter cannot safely represent all regular expressions. The documentation shows the environment variable form but does not prominently document the delimiter behavior or this collision.

Suggested improvements

  • Use the same delimiter for environment variables and labels, preferably one that does not commonly occur in regex syntax, or support a structured/repeated environment-variable form for regex lists.
  • Clearly document the delimiter for both DIUN_DEFAULTS_INCLUDETAGS and diun.include_tags.
  • Add an example showing a regex containing a quantifier such as {2,}.
  • Consider validation or a more actionable error when a comma-split environment value produces invalid regex fragments.

The current workaround is to rewrite the environment regex without a comma, for example using explicit repetition and an optional repeated suffix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions