Skip to content

Add runtime config handler#936

Merged
mapno merged 6 commits intografana:mainfrom
mapno:overrides-handler
Sep 13, 2021
Merged

Add runtime config handler#936
mapno merged 6 commits intografana:mainfrom
mapno:overrides-handler

Conversation

@mapno
Copy link
Copy Markdown
Contributor

@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]

Comment thread modules/overrides/overrides.go Outdated
@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor 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