From df276b83f1b2e52bcc78acdfe8b894bae0154042 Mon Sep 17 00:00:00 2001 From: Filipe Regadas Date: Fri, 21 Jan 2022 17:45:02 +0000 Subject: [PATCH] Avoid throwing on PodGroup deletion when NotFound (#217) This will most likely mean that the PodGroup was deleted or it was never created. In either case we don't want to fail the reconcile loop. --- controllers/flinkcluster/batchscheduler/volcano/volcano.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/controllers/flinkcluster/batchscheduler/volcano/volcano.go b/controllers/flinkcluster/batchscheduler/volcano/volcano.go index 798494b8..0a249532 100644 --- a/controllers/flinkcluster/batchscheduler/volcano/volcano.go +++ b/controllers/flinkcluster/batchscheduler/volcano/volcano.go @@ -162,7 +162,12 @@ func (v *VolcanoBatchScheduler) deletePodGroup(cluster *v1beta1.FlinkCluster) er func (v *VolcanoBatchScheduler) syncPodGroup(cluster *v1beta1.FlinkCluster, state *model.DesiredClusterState) (*scheduling.PodGroup, error) { if state.JmStatefulSet == nil && state.TmStatefulSet == nil { // remove the podgroup if the JobManager/TaskManager statefulset are not set - return nil, v.deletePodGroup(cluster) + err := v.deletePodGroup(cluster) + if !errors.IsNotFound(err) { + return nil, err + } + + return nil, nil } minResource, size := getClusterResource(state)