Skip to content

Support multiple cases for VMAlertmanagerConfig and scrape configs#2233

Open
AndrewChubatiuk wants to merge 1 commit into
masterfrom
support-multiple-cases
Open

Support multiple cases for VMAlertmanagerConfig and scrape configs#2233
AndrewChubatiuk wants to merge 1 commit into
masterfrom
support-multiple-cases

Conversation

@AndrewChubatiuk

@AndrewChubatiuk AndrewChubatiuk commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

fixes #1146


Summary by cubic

Adds case-insensitive support for both snake_case and camelCase in scrape CRDs and VMAlertmanagerConfig, with strict spec validation and clearer errors. Preserves unknown fields in VMAlertmanagerConfig.spec and removes underscore-only aliases across the API and controller.

  • New Features

    • Accept both naming styles via case:ignore tags on scrape params and json.MatchCaseInsensitiveNames(true) + json.RejectUnknownMembers(true) during spec unmarshalling; errors now say “unknown object member name”.
    • Preserve unknown fields in VMAlertmanagerConfig.spec (x-kubernetes-preserve-unknown-fields: true, +kubebuilder:pruning:PreserveUnknownFields).
    • Remove underscore-only aliases and fallbacks (host_aliases, UnderScoreSourceLabels, UnderScoreTargetLabel); CRD schemas, controller logic, docs, and tests updated. API docs show both accepted aliases.
  • Dependencies

    • Add github.com/go-json-experiment/json.

Written for commit 7dc2589. Summary will update on new commits.

Review in cubic

@AndrewChubatiuk AndrewChubatiuk requested a review from vrutkovs as a code owner June 1, 2026 06:48
@AndrewChubatiuk AndrewChubatiuk changed the title Support multiple cases Support multiple cases for VMAlertmanagerConfig and scrape configs Jun 1, 2026
@AndrewChubatiuk AndrewChubatiuk force-pushed the support-multiple-cases branch from 93e3461 to ee74e84 Compare June 1, 2026 06:50

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

8 issues found across 42 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread cmd/config-reloader/file_watch.go Outdated
Comment thread internal/controller/operator/factory/vmscrapes/extra_config.go Outdated
Comment thread cmd/config-reloader/file_watch.go Outdated
Comment thread api/operator/v1beta1/vmalertmanagerconfig_test.go
Comment thread cmd/config-reloader/main.go
Comment thread internal/controller/operator/factory/vmalert/vmalert.go
Comment thread internal/controller/operator/factory/vmscrapes/extra_config.go Outdated
Comment thread api/operator/v1beta1/common_scrapeparams.go Outdated
@AndrewChubatiuk AndrewChubatiuk force-pushed the support-multiple-cases branch 4 times, most recently from bdbd13d to 8007250 Compare June 1, 2026 07:56
@AndrewChubatiuk

Copy link
Copy Markdown
Contributor Author

@cubic-ai-dev

@cubic-dev-ai

cubic-dev-ai Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-ai-dev

@AndrewChubatiuk I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 35 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread api/operator/v1beta1/vmservicescrape_types.go Outdated
Comment thread internal/controller/operator/factory/vmscrapes/vmscrapes_test.go Outdated
@AndrewChubatiuk AndrewChubatiuk force-pushed the support-multiple-cases branch 7 times, most recently from ae83fb0 to 04bc75c Compare June 2, 2026 11:18
@AndrewChubatiuk AndrewChubatiuk force-pushed the support-multiple-cases branch 2 times, most recently from afbff0c to 45cca9d Compare June 15, 2026 14:41
@AndrewChubatiuk AndrewChubatiuk force-pushed the support-multiple-cases branch from 45cca9d to 7dc2589 Compare June 15, 2026 18:22
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.

Please use consistent casing in api fields

1 participant