Skip to content

Commit 79fdea9

Browse files
committed
Fix TCP Policy deletion when policy is already deleted
1 parent 166091b commit 79fdea9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/controller/nbpolicy_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ func (r *NBPolicyReconciler) syncPolicy(ctx context.Context, nbPolicy *netbirdio
323323
func (r *NBPolicyReconciler) handleDelete(ctx context.Context, nbPolicy netbirdiov1.NBPolicy, logger logr.Logger) error {
324324
if nbPolicy.Status.TCPPolicyID != nil {
325325
err := r.netbird.Policies.Delete(ctx, *nbPolicy.Status.TCPPolicyID)
326-
if err != nil {
326+
if err != nil && !strings.Contains("not found", err.Error()) {
327327
return err
328328
}
329329
nbPolicy.Status.TCPPolicyID = nil

0 commit comments

Comments
 (0)