mirror of
https://github.com/arangodb/kube-arangodb.git
synced 2024-12-14 11:57:37 +00:00
[BUGFIX] Do not remove not know pvcs (#558)
This commit is contained in:
parent
7f8dfeaa20
commit
e41748d0e6
2 changed files with 2 additions and 12 deletions
|
@ -1,8 +1,9 @@
|
|||
# Change Log
|
||||
|
||||
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
|
||||
- Prevent deletion not known PVC's
|
||||
|
||||
## [1.0.1](https://github.com/arangodb/kube-arangodb/tree/1.0.1) (2020-04-16)
|
||||
## [1.0.2](https://github.com/arangodb/kube-arangodb/tree/1.0.2) (2020-04-16)
|
||||
- Added additional checks in UpToDate condition
|
||||
- Added extended Rotation check for Cluster mode
|
||||
- Removed old rotation logic (rotation of ArangoDeployment may be enforced after Operator upgrade)
|
||||
|
|
|
@ -65,17 +65,6 @@ func (r *Resources) InspectPVCs(ctx context.Context) (util.Interval, error) {
|
|||
memberStatus, group, found := status.Members.MemberStatusByPVCName(p.GetName())
|
||||
if !found {
|
||||
log.Debug().Str("pvc", p.GetName()).Msg("no memberstatus found for PVC")
|
||||
if k8sutil.IsPersistentVolumeClaimMarkedForDeletion(&p) && len(p.GetFinalizers()) > 0 {
|
||||
// Strange, pvc belongs to us, but we have no member for it.
|
||||
// Remove all finalizers, so it can be removed.
|
||||
log.Warn().Msg("PVC belongs to this deployment, but we don't know the member. Removing all finalizers")
|
||||
kubecli := r.context.GetKubeCli()
|
||||
ignoreNotFound := false
|
||||
if err := k8sutil.RemovePVCFinalizers(log, kubecli, &p, p.GetFinalizers(), ignoreNotFound); err != nil {
|
||||
log.Debug().Err(err).Msg("Failed to update PVC (to remove all finalizers)")
|
||||
return 0, maskAny(err)
|
||||
}
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue