Plugins: Backend: Skip host environment variables (#77858)
* Add pluginsSkipHostEnvVars feature flag * Set go-plugin's SkipHostEnvVar depending on feature flags * add missing file * Re-generate feature flags * Add allowedHostEnvVarNames * Fix feature toggles not being passed to plugin context service's plugin env vars * Fix tests * PR review feedback: Use cfg.Features * Fix tests * PR review feedback: removed DefaultProviderWithFeatures * merge with master * fix tests * use features.IsEnabledGlobally
This commit is contained in:
@@ -1063,6 +1063,13 @@ var (
|
||||
Owner: grafanaAlertingSquad,
|
||||
HideFromDocs: true,
|
||||
},
|
||||
{
|
||||
Name: "pluginsSkipHostEnvVars",
|
||||
Description: "Disables passing host environment variable to plugin processes",
|
||||
Stage: FeatureStageExperimental,
|
||||
FrontendOnly: false,
|
||||
Owner: grafanaPluginsPlatformSquad,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -143,3 +143,4 @@ flameGraphItemCollapsing,experimental,@grafana/observability-traces-and-profilin
|
||||
alertingDetailsViewV2,experimental,@grafana/alerting-squad,false,false,false,true
|
||||
datatrails,experimental,@grafana/dashboards-squad,false,false,false,true
|
||||
alertingSimplifiedRouting,experimental,@grafana/alerting-squad,false,false,false,false
|
||||
pluginsSkipHostEnvVars,experimental,@grafana/plugins-platform-backend,false,false,false,false
|
||||
|
||||
|
@@ -582,4 +582,8 @@ const (
|
||||
// FlagAlertingSimplifiedRouting
|
||||
// Enables the simplified routing for alerting
|
||||
FlagAlertingSimplifiedRouting = "alertingSimplifiedRouting"
|
||||
|
||||
// FlagPluginsSkipHostEnvVars
|
||||
// Disables passing host environment variable to plugin processes
|
||||
FlagPluginsSkipHostEnvVars = "pluginsSkipHostEnvVars"
|
||||
)
|
||||
|
||||
@@ -54,7 +54,7 @@ func CreateIntegrationTestCtx(t *testing.T, cfg *setting.Cfg, coreRegistry *core
|
||||
disc := pipeline.ProvideDiscoveryStage(pCfg, finder.NewLocalFinder(true), reg)
|
||||
boot := pipeline.ProvideBootstrapStage(pCfg, signature.ProvideService(pCfg, statickey.New()), assetpath.ProvideService(pCfg, cdn))
|
||||
valid := pipeline.ProvideValidationStage(pCfg, signature.NewValidator(signature.NewUnsignedAuthorizer(pCfg)), angularInspector, errTracker)
|
||||
init := pipeline.ProvideInitializationStage(pCfg, reg, fakes.NewFakeLicensingService(), provider.ProvideService(coreRegistry), proc, &fakes.FakeAuthService{}, fakes.NewFakeRoleRegistry())
|
||||
init := pipeline.ProvideInitializationStage(pCfg, reg, fakes.NewFakeLicensingService(), provider.ProvideService(featuremgmt.WithFeatures(), coreRegistry), proc, &fakes.FakeAuthService{}, fakes.NewFakeRoleRegistry())
|
||||
term, err := pipeline.ProvideTerminationStage(pCfg, reg, proc)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -100,7 +100,7 @@ func CreateTestLoader(t *testing.T, cfg *pluginsCfg.Cfg, opts LoaderOpts) *loade
|
||||
if opts.Initializer == nil {
|
||||
reg := registry.ProvideService()
|
||||
coreRegistry := coreplugin.NewRegistry(make(map[string]backendplugin.PluginFactoryFunc))
|
||||
opts.Initializer = pipeline.ProvideInitializationStage(cfg, reg, fakes.NewFakeLicensingService(), provider.ProvideService(coreRegistry), process.ProvideService(), &fakes.FakeAuthService{}, fakes.NewFakeRoleRegistry())
|
||||
opts.Initializer = pipeline.ProvideInitializationStage(cfg, reg, fakes.NewFakeLicensingService(), provider.ProvideService(featuremgmt.WithFeatures(), coreRegistry), process.ProvideService(), &fakes.FakeAuthService{}, fakes.NewFakeRoleRegistry())
|
||||
}
|
||||
|
||||
if opts.Terminator == nil {
|
||||
|
||||
Reference in New Issue
Block a user