Skip to content

Hardening: extract operator prefixes from constraint values#4

Open
irfan-evoila wants to merge 2 commits intomainfrom
refactor/label-processor-pipeline
Open

Hardening: extract operator prefixes from constraint values#4
irfan-evoila wants to merge 2 commits intomainfrom
refactor/label-processor-pipeline

Conversation

@irfan-evoila
Copy link
Copy Markdown
Contributor

@irfan-evoila irfan-evoila commented Feb 10, 2026

Refactored the monolithic LabelProcessor (774 lines) into a clean linear pipeline with clear separation of concerns:
Parse -> Normalize -> Enhance -> Validate -> Serialize.

Each step is now handled by a focused class (LabelParser, LabelNormalizer, LabelEnhancer), resulting in a more robust and maintainable architecture for future changes

Constraint values can encode operators as prefixes (e.g. !~^kube-.*).

Previously, these were treated as raw values and wrapped with the default =~ operator,
producing incorrect expressions like k8s_namespace_name="!^kube-.*".

Now LabelEnhancer extracts !, =, and != prefixes from constraint values and uses them as the actual operator.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants