Support label namespaces based on prefixes#4
Conversation
|
🚀 Merging this PR will release Merging will trigger workflows 🛠️ Auto tagging enabled with label |
235df24 to
5f9cfb6
Compare
5f9cfb6 to
754493c
Compare
There was a problem hiding this comment.
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.
| 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 []; |
There was a problem hiding this comment.
Prefix and contains labels should probably be concatenated.
There was a problem hiding this comment.
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
754493c to
65e7ed1
Compare
65e7ed1 to
7c75f63
Compare
Checklist
changelog.
The PR has a meaningful description that sums up the change. It will be
linked in the changelog.
bug,enhancement,documentation,change,breaking,dependencyas they show up in the changelog.