Skip to content

Commit e41748d

Browse files
authored
[BUGFIX] Do not remove not know pvcs (#558)
1 parent 7f8dfea commit e41748d

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Change Log
22

33
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
4+
- Prevent deletion not known PVC's
45

5-
## [1.0.1](https://github.com/arangodb/kube-arangodb/tree/1.0.1) (2020-04-16)
6+
## [1.0.2](https://github.com/arangodb/kube-arangodb/tree/1.0.2) (2020-04-16)
67
- Added additional checks in UpToDate condition
78
- Added extended Rotation check for Cluster mode
89
- Removed old rotation logic (rotation of ArangoDeployment may be enforced after Operator upgrade)

pkg/deployment/resources/pvc_inspector.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,6 @@ func (r *Resources) InspectPVCs(ctx context.Context) (util.Interval, error) {
6565
memberStatus, group, found := status.Members.MemberStatusByPVCName(p.GetName())
6666
if !found {
6767
log.Debug().Str("pvc", p.GetName()).Msg("no memberstatus found for PVC")
68-
if k8sutil.IsPersistentVolumeClaimMarkedForDeletion(&p) && len(p.GetFinalizers()) > 0 {
69-
// Strange, pvc belongs to us, but we have no member for it.
70-
// Remove all finalizers, so it can be removed.
71-
log.Warn().Msg("PVC belongs to this deployment, but we don't know the member. Removing all finalizers")
72-
kubecli := r.context.GetKubeCli()
73-
ignoreNotFound := false
74-
if err := k8sutil.RemovePVCFinalizers(log, kubecli, &p, p.GetFinalizers(), ignoreNotFound); err != nil {
75-
log.Debug().Err(err).Msg("Failed to update PVC (to remove all finalizers)")
76-
return 0, maskAny(err)
77-
}
78-
}
7968
continue
8069
}
8170

0 commit comments

Comments
 (0)