From fee6b504638488f1dbb57583495e504dab27f970 Mon Sep 17 00:00:00 2001 From: Filipe Regadas Date: Thu, 13 Jan 2022 16:43:46 -0500 Subject: [PATCH] Fix: check if StatefulSet is set as PVC owner ref (#206) --- controllers/flinkcluster_reconciler.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/controllers/flinkcluster_reconciler.go b/controllers/flinkcluster_reconciler.go index 6ce57dd4..98fc7939 100644 --- a/controllers/flinkcluster_reconciler.go +++ b/controllers/flinkcluster_reconciler.go @@ -476,8 +476,10 @@ func (reconciler *ClusterReconciler) reconcilePersistentVolumeClaim(pvc *corev1. ctx := reconciler.context k8sClient := reconciler.k8sClient - if len(pvc.GetOwnerReferences()) != 0 { - return nil + for _, ownerRef := range pvc.GetOwnerReferences() { + if ownerRef.Kind == sset.Kind { + return nil + } } patch := fmt.Sprintf(