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

Add runtime config handler #936

Merged
merged 6 commits into from
Sep 13, 2021
Merged

Add runtime config handler #936

merged 6 commits into from
Sep 13, 2021

Conversation

mapno
Copy link
Member

@mapno mapno commented Sep 7, 2021

What this PR does:

Adds a runtime config handler at /runtime_config

Which issue(s) this PR fixes:
Fixes #893

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@mapno mapno marked this pull request as ready for review September 9, 2021 16:15
@mapno mapno force-pushed the overrides-handler branch 2 times, most recently from aff22f8 to 3c85788 Compare September 10, 2021 11:46
Copy link
Contributor

@annanay25 annanay25 left a comment

Choose a reason for hiding this comment

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

Looking good, nice work @mapno! Left a minor comment.

// we set defaultLimits for every tenant that exists in runtime config.
defaultCfg := perTenantOverrides{TenantLimits: map[string]*Limits{}}
defaultCfg.TenantLimits = map[string]*Limits{}
for k, v := range tenantOverrides.TenantLimits {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this will result in null pointer dereference if o.tenantOverrides == nil

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's fine since we're instantiating a zero value in line 153 and only assign a value if o.tenantOverrides() != nil

@mapno mapno merged commit 6ca8535 into grafana:main Sep 13, 2021
@mapno mapno deleted the overrides-handler branch September 13, 2021 13:02
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.

Add a runtime config handler
2 participants