mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
move tracing instantiation further up, and check for nil
This commit is contained in:
parent
79d400c441
commit
b0ffaa93f5
@ -104,6 +104,14 @@ func (o *RecommendedOptions) ApplyTo(config *server.RecommendedConfig) error {
|
|||||||
if err := o.Etcd.ApplyTo(&config.Config); err != nil {
|
if err := o.Etcd.ApplyTo(&config.Config); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if err := o.EgressSelector.ApplyTo(&config.Config); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if feature.DefaultFeatureGate.Enabled(features.APIServerTracing) {
|
||||||
|
if err := o.Traces.ApplyTo(config.Config.EgressSelector, &config.Config); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
if err := o.SecureServing.ApplyTo(&config.Config.SecureServing, &config.Config.LoopbackClientConfig); err != nil {
|
if err := o.SecureServing.ApplyTo(&config.Config.SecureServing, &config.Config.LoopbackClientConfig); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -119,14 +127,6 @@ func (o *RecommendedOptions) ApplyTo(config *server.RecommendedConfig) error {
|
|||||||
if err := o.Features.ApplyTo(&config.Config); err != nil {
|
if err := o.Features.ApplyTo(&config.Config); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := o.EgressSelector.ApplyTo(&config.Config); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if feature.DefaultFeatureGate.Enabled(features.APIServerTracing) {
|
|
||||||
if err := o.Traces.ApplyTo(config.Config.EgressSelector, &config.Config); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err := o.CoreAPI.ApplyTo(config); err != nil {
|
if err := o.CoreAPI.ApplyTo(config); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,9 @@ func (o *TracingOptions) ApplyTo(es *egressselector.EgressSelector, c *server.Co
|
|||||||
}
|
}
|
||||||
tp := traces.NewProvider(context.Background(), sampler, resourceOpts, opts...)
|
tp := traces.NewProvider(context.Background(), sampler, resourceOpts, opts...)
|
||||||
c.TracerProvider = &tp
|
c.TracerProvider = &tp
|
||||||
c.LoopbackClientConfig.Wrap(traces.WrapperFor(c.TracerProvider))
|
if c.LoopbackClientConfig != nil {
|
||||||
|
c.LoopbackClientConfig.Wrap(traces.WrapperFor(c.TracerProvider))
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user