Skip to content

Commit

Permalink
fix: avoid panic in case instrumentationConfig deleted (#1514)
Browse files Browse the repository at this point in the history
Co-authored-by: Tamir David <[email protected]>
  • Loading branch information
tamirdavid1 and Tamir David authored Sep 17, 2024
1 parent 779b6cc commit 4e1d6f5
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
odigosv1 "github.com/odigos-io/odigos/api/odigos/v1alpha1"
"github.com/odigos-io/odigos/k8sutils/pkg/workload"
"github.com/odigos-io/odigos/opampserver/pkg/connection"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand All @@ -23,11 +22,7 @@ func (i *InstrumentationConfigReconciler) Reconcile(ctx context.Context, req ctr
err := i.Get(ctx, req.NamespacedName, instrumentationConfig)

if err != nil {
if apierrors.IsNotFound(err) {
instrumentationConfig = nil
} else {
return ctrl.Result{}, err
}
return ctrl.Result{}, client.IgnoreNotFound(err)
}

workloadName, workloadKind, err := workload.ExtractWorkloadInfoFromRuntimeObjectName(req.Name)
Expand Down

0 comments on commit 4e1d6f5

Please sign in to comment.