Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate user-configurable overrides #2682

Merged
merged 6 commits into from
Jul 24, 2023

Conversation

kvrhdn
Copy link
Member

@kvrhdn kvrhdn commented Jul 20, 2023

What this PR does:
Validate the user-configurable overrides before storing them in the backend.

I've also split off overrides-api into a separate module to make matters more explicit. This also opens the way to running the override-api as a separate component.

Note this will conflict slightly with #2681. I can address merge conflicts when either PR gets merged.

Which issue(s) this PR fixes:
Fixes #

Checklist

Copy link
Member

@mapno mapno left a comment

Choose a reason for hiding this comment

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

LGTM


if limits.Forwarders != nil {
for _, f := range *limits.Forwarders {
if !slices.Contains(validForwarders, f) {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: a map would be more efficient

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I've updated the implementation :)

@kvrhdn kvrhdn merged commit 0e65852 into grafana:main Jul 24, 2023
13 checks passed
@kvrhdn kvrhdn deleted the kvrhdn/overrides-validation branch July 24, 2023 12:05
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.

2 participants