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

SSO: fix reloading settings when a provider contains empty settings #85102

Merged
merged 3 commits into from Mar 25, 2024

Conversation

dmihai
Copy link
Contributor

@dmihai dmihai commented Mar 25, 2024

What is this feature?

Prevents reloading of SSO settings for providers that have empty settings.

Why do we need this feature?

If a providers has empty settings then Grafana will panic because it tries to dereference a nil settings pointer at this line from the doReload() function:

err = connector.Reload(ctx, *settings)

Who is this feature for?

everybody

Which issue(s) does this PR fix?:

Fixes #

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@dmihai dmihai requested a review from a team March 25, 2024 16:19
@dmihai dmihai requested a review from a team as a code owner March 25, 2024 16:19
@grafana-delivery-bot grafana-delivery-bot bot added this to the 11.0.x milestone Mar 25, 2024
@@ -365,9 +365,15 @@ func (s *Service) doReload(ctx context.Context) {
}

for provider, connector := range s.reloadables {
setting := getSettingByProvider(provider, settingsList)
settings := getSettingByProvider(provider, settingsList)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I replaced setting with settings because we had a name collision with the package setting.

@dmihai dmihai added the no-changelog Skip including change in changelog/release notes label Mar 25, 2024
@dmihai dmihai merged commit fad6dc4 into main Mar 25, 2024
12 checks passed
@dmihai dmihai deleted the dmihai/fix-sso-reload-empty-settings branch March 25, 2024 17:12
@ashharrison90 ashharrison90 added product-approved Pull requests that are approved by product/managers and are allowed to be backported backport v11.0.x Mark PR for automatic backport to v11.0.x labels Apr 15, 2024
grafana-delivery-bot bot pushed a commit that referenced this pull request Apr 15, 2024
…85102)

* fix reloading settings when a provider contains empty settings

* do not increment reloadFailures if settings are empty

(cherry picked from commit fad6dc4)
ashharrison90 pushed a commit that referenced this pull request Apr 15, 2024
…settings (#86142)

SSO: fix reloading settings when a provider contains empty settings (#85102)

* fix reloading settings when a provider contains empty settings

* do not increment reloadFailures if settings are empty

(cherry picked from commit fad6dc4)

Co-authored-by: Mihai Doarna <mihai.doarna@grafana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend backport v11.0.x Mark PR for automatic backport to v11.0.x no-changelog Skip including change in changelog/release notes product-approved Pull requests that are approved by product/managers and are allowed to be backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants