Skip to content

Support label namespaces based on prefixes#4

Open
DebakelOrakel wants to merge 1 commit intomasterfrom
feat/support-dynamic-labels
Open

Support label namespaces based on prefixes#4
DebakelOrakel wants to merge 1 commit intomasterfrom
feat/support-dynamic-labels

Conversation

@DebakelOrakel
Copy link
Copy Markdown
Contributor

@DebakelOrakel DebakelOrakel commented May 8, 2026

Checklist

  • The PR has a meaningful title. It will be used to auto-generate the
    changelog.
    The PR has a meaningful description that sums up the change. It will be
    linked in the changelog.
  • PR contains a single logical change (to build a better changelog).
  • Update the documentation.
  • Categorize the PR by adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog.
  • Link this PR to related issues or PRs.

@DebakelOrakel DebakelOrakel added enhancement New feature or request bump:minor labels May 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

🚀 Merging this PR will release v0.2.0

Merging will trigger workflows Release

🛠️ Auto tagging enabled with label bump:minor

@DebakelOrakel DebakelOrakel force-pushed the feat/support-dynamic-labels branch from 235df24 to 5f9cfb6 Compare May 8, 2026 09:32
@DebakelOrakel DebakelOrakel requested a review from a team May 8, 2026 09:32
@DebakelOrakel DebakelOrakel force-pushed the feat/support-dynamic-labels branch from 5f9cfb6 to 754493c Compare May 8, 2026 09:33
Copy link
Copy Markdown
Member

@bastjan bastjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There needs to be some thought and documentation put into colliding matchers.

Currently only the first match is taken. Since matches are dicts and not arrays this can change with any change in the yaml or json (de)serializer. The spec does not guarantee key ordering.

My prefered way is a field manager join("component", "prefix", key) per label matcher. This would allow for multiple labels to be applied.

Comment thread class/defaults.yml
Comment on lines +40 to +55
else if labelsFromContains(namespace) != {} then [
namespace {
metadata+: {
labels+: labelsFromContains(namespace),
},
},
]
// Apply labels if the namespace name starts with defined prefix
else if labelsFromPrefix(namespace) != {} then [
namespace {
metadata+: {
labels+: labelsFromPrefix(namespace),
},
},
]
else [];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefix and contains labels should probably be concatenated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont like the contains at all, but we have it in place for one customer.
i could get rid of it in that component and deal with the exception seperatly

@DebakelOrakel DebakelOrakel force-pushed the feat/support-dynamic-labels branch from 754493c to 65e7ed1 Compare May 8, 2026 11:57
@DebakelOrakel DebakelOrakel requested a review from bastjan May 8, 2026 11:59
@DebakelOrakel DebakelOrakel force-pushed the feat/support-dynamic-labels branch from 65e7ed1 to 7c75f63 Compare May 8, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bump:minor enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants