Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Schulze committed May 23, 2022
1 parent b11a505 commit 0d49828
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions internal/ingress/controller/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -1607,37 +1607,19 @@ func shouldLoadOpentracingModule(c interface{}, s interface{}) bool {
}

// shouldLoadOpentelemetryModule determines whether or not the Opentelemetry module needs to be loaded.
// First, it checks if `enable-opentelemetry` is set in the ConfigMap. If it is not, it iterates over all locations to
// check if Opentracing is enabled by the annotation `nginx.ingress.kubernetes.io/enable-opentelemetry`.
// It checks if `enable-opentelemetry` is set in the ConfigMap.
func shouldLoadOpentelemetryModule(c interface{}, s interface{}) bool {
cfg, ok := c.(config.Configuration)
if !ok {
klog.Errorf("expected a 'config.Configuration' type but %T was returned", c)
return false
}

// servers, ok := s.([]*ingress.Server)
// if !ok {
// klog.Errorf("expected an '[]*ingress.Server' type but %T was returned", s)
// return false
// }

if cfg.EnableOpentelemetry {
return true
}

return false

// // TODO
// for _, server := range servers {
// for _, location := range server.Locations {
// if location.Opentracing.Enabled {
// return true
// }
// }
// }

// return false

}

Expand Down

0 comments on commit 0d49828

Please sign in to comment.