Skip to content

Commit

Permalink
remove finalizers for pods in finalizeIfNecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
srteam2020 authored and smiklosovic committed Jan 25, 2021
1 parent bd8077a commit 1b91817
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/controller/cassandradatacenter/finalizers.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ func (r *ReconcileCassandraDataCenter) finalizeIfNecessary(reqLogger logr.Logger
return false, err
}

pods, err := AllPodsInCDC(r.client, instance)
if err != nil {
return false, err
}
for _, pod := range pods {
pod.SetFinalizers(remove(pod.GetFinalizers(), pvcDeletionFinalizerForPod))
if err := r.client.Update(context.TODO(), &pod); err != nil {
return false, err
}
}

return true, nil
}

Expand Down

0 comments on commit 1b91817

Please sign in to comment.