Skip to content

Commit

Permalink
Remove duplicate import
Browse files Browse the repository at this point in the history
  • Loading branch information
khewonc committed Jan 7, 2025
1 parent 1790b63 commit c9656fc
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -379,10 +378,8 @@ func (r *Reconciler) cleanupPodsForProfilesThatNoLongerApply(ctx context.Context
Name: agentPod.Name,
},
}
if err = r.client.Delete(ctx, &toDelete); err != nil {
if !apierrors.IsNotFound(err) {
return err
}
if err = r.client.Delete(ctx, &toDelete); err != nil && !errors.IsNotFound(err) {
return err
}
}
}
Expand Down

0 comments on commit c9656fc

Please sign in to comment.