mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
K8s: use contexthandler in standalone handler chain (#90102)
This commit is contained in:
@@ -74,15 +74,15 @@ func newCommandStartExampleAPIServer(o *APIServerOptions, stopCh <-chan struct{}
|
||||
return err
|
||||
}
|
||||
|
||||
config, err := o.Config()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if o.Options.TracingOptions.TracingService != nil {
|
||||
tracer.InitTracer(o.Options.TracingOptions.TracingService)
|
||||
}
|
||||
|
||||
config, err := o.Config(tracer)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer o.factory.Shutdown()
|
||||
|
||||
if err := o.RunAPIServer(config, stopCh); err != nil {
|
||||
|
||||
@@ -76,7 +76,7 @@ func (o *APIServerOptions) loadAPIGroupBuilders(ctx context.Context, tracer trac
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *APIServerOptions) Config() (*genericapiserver.RecommendedConfig, error) {
|
||||
func (o *APIServerOptions) Config(tracer tracing.Tracer) (*genericapiserver.RecommendedConfig, error) {
|
||||
if err := o.Options.RecommendedOptions.SecureServing.MaybeDefaultWithSelfSignedCerts(
|
||||
"localhost", o.AlternateDNS, []net.IP{netutils.ParseIPSloppy("127.0.0.1")},
|
||||
); err != nil {
|
||||
@@ -122,6 +122,7 @@ func (o *APIServerOptions) Config() (*genericapiserver.RecommendedConfig, error)
|
||||
setting.BuildVersion,
|
||||
setting.BuildCommit,
|
||||
setting.BuildBranch,
|
||||
o.factory.GetOptionalMiddlewares(tracer)...,
|
||||
)
|
||||
return serverConfig, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user