mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Cfg: Adds experimental scope grafana.ini settings (#83174)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
@@ -262,4 +262,7 @@ type FrontendSettingsDTO struct {
|
||||
Whitelabeling *FrontendSettingsWhitelabelingDTO `json:"whitelabeling,omitempty"`
|
||||
|
||||
LocalFileSystemAvailable bool `json:"localFileSystemAvailable"`
|
||||
// Experimental Scope settings
|
||||
ListScopesEndpoint string `json:"listScopesEndpoint"`
|
||||
ListDashboardScopesEndpoint string `json:"listDashboardScopesEndpoint"`
|
||||
}
|
||||
|
||||
@@ -356,6 +356,12 @@ func (hs *HTTPServer) getFrontendSettings(c *contextmodel.ReqContext) (*dtos.Fro
|
||||
// Set the kubernetes namespace
|
||||
frontendSettings.Namespace = hs.namespacer(c.SignedInUser.OrgID)
|
||||
|
||||
// experimental scope features
|
||||
if hs.Features.IsEnabled(c.Req.Context(), featuremgmt.FlagScopeFilters) {
|
||||
frontendSettings.ListScopesEndpoint = hs.Cfg.ScopesListScopesURL
|
||||
frontendSettings.ListDashboardScopesEndpoint = hs.Cfg.ScopesListDashboardsURL
|
||||
}
|
||||
|
||||
return frontendSettings, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1197,6 +1197,17 @@ var (
|
||||
RequiresRestart: true,
|
||||
Expression: "true", // enabled by default
|
||||
},
|
||||
{
|
||||
Name: "scopeFilters",
|
||||
Description: "Enables the use of scope filters in Grafana",
|
||||
FrontendOnly: false,
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaDashboardsSquad,
|
||||
RequiresRestart: false,
|
||||
AllowSelfServe: false,
|
||||
HideFromDocs: true,
|
||||
HideFromAdminPage: true,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -160,3 +160,4 @@ kubernetesAggregator,experimental,@grafana/grafana-app-platform-squad,false,true
|
||||
expressionParser,experimental,@grafana/grafana-app-platform-squad,false,true,false
|
||||
groupByVariable,experimental,@grafana/dashboards-squad,false,false,false
|
||||
alertingUpgradeDryrunOnStart,GA,@grafana/alerting-squad,false,true,false
|
||||
scopeFilters,experimental,@grafana/dashboards-squad,false,false,false
|
||||
|
||||
|
@@ -650,4 +650,8 @@ const (
|
||||
// FlagAlertingUpgradeDryrunOnStart
|
||||
// When activated in legacy alerting mode, this initiates a dry-run of the Unified Alerting upgrade during each startup. It logs any issues detected without implementing any actual changes.
|
||||
FlagAlertingUpgradeDryrunOnStart = "alertingUpgradeDryrunOnStart"
|
||||
|
||||
// FlagScopeFilters
|
||||
// Enables the use of scope filters in Grafana
|
||||
FlagScopeFilters = "scopeFilters"
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -521,6 +521,10 @@ type Cfg struct {
|
||||
|
||||
// News Feed
|
||||
NewsFeedEnabled bool
|
||||
|
||||
// Experimental scope settings
|
||||
ScopesListScopesURL string
|
||||
ScopesListDashboardsURL string
|
||||
}
|
||||
|
||||
// AddChangePasswordLink returns if login form is disabled or not since
|
||||
@@ -1281,6 +1285,11 @@ func (cfg *Cfg) parseINIFile(iniFile *ini.File) error {
|
||||
cfg.readFeatureManagementConfig()
|
||||
cfg.readPublicDashboardsSettings()
|
||||
|
||||
// read experimental scopes settings.
|
||||
scopesSection := iniFile.Section("scopes")
|
||||
cfg.ScopesListScopesURL = scopesSection.Key("list_scopes_endpoint").MustString("")
|
||||
cfg.ScopesListDashboardsURL = scopesSection.Key("list_dashboards_endpoint").MustString("")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user