From 2579c762e205dcaa1911159a87b3ab1722fb3444 Mon Sep 17 00:00:00 2001 From: Giovanni Liva Date: Tue, 15 Nov 2022 10:12:36 +0100 Subject: [PATCH] fix(operator): Use correct parent/child span relationship Signed-off-by: Giovanni Liva --- operator/controllers/common/phasehandler.go | 2 +- operator/controllers/keptnappversion/controller.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/operator/controllers/common/phasehandler.go b/operator/controllers/common/phasehandler.go index aaf451e1b8f..3a7424ba8f6 100644 --- a/operator/controllers/common/phasehandler.go +++ b/operator/controllers/common/phasehandler.go @@ -41,7 +41,7 @@ func (r PhaseHandler) HandlePhase(ctx context.Context, ctxAppTrace context.Conte piWrapper.SetCurrentPhase(phase.ShortName) r.Log.Info(phase.LongName + " not finished") - ctxAppTrace, spanAppTrace, err := r.SpanHandler.GetSpan(ctxAppTrace, tracer, reconcileObject, phase.ShortName) + _, spanAppTrace, err := r.SpanHandler.GetSpan(ctxAppTrace, tracer, reconcileObject, phase.ShortName) if err != nil { r.Log.Error(err, "could not get span") } diff --git a/operator/controllers/keptnappversion/controller.go b/operator/controllers/keptnappversion/controller.go index 4435f0e8352..9510431681f 100644 --- a/operator/controllers/keptnappversion/controller.go +++ b/operator/controllers/keptnappversion/controller.go @@ -117,7 +117,8 @@ func (r *KeptnAppVersionReconciler) Reconcile(ctx context.Context, req ctrl.Requ r.Log.Error(err, "cannot unbind span") } var spanAppTrace trace.Span - ctxAppTrace, spanAppTrace, err = r.SpanHandler.GetSpan(ctxAppTrace, r.Tracer, appVersion, phase.ShortName) + // ignoring ctx to don't use this as parent span + _, spanAppTrace, err = r.SpanHandler.GetSpan(ctxAppTrace, r.Tracer, appVersion, phase.ShortName) if err != nil { r.Log.Error(err, "could not get span") }