From 2f585ab0c6054caa06ca499867955fde626634b4 Mon Sep 17 00:00:00 2001 From: swiencki Date: Thu, 6 May 2021 10:29:22 -0700 Subject: [PATCH] Adding retry logic to delete. Related to https://github.com/Azure/ARO-RP/pull/1447 --- pkg/cluster/delete.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/delete.go b/pkg/cluster/delete.go index b73fed41e..d7bed0b49 100644 --- a/pkg/cluster/delete.go +++ b/pkg/cluster/delete.go @@ -284,8 +284,15 @@ func (m *manager) Delete(ctx context.Context) error { return err } - m.log.Printf("deleting resources") - err = m.deleteResources(ctx) + // Retry logic due to race condition between PLS and nic + // TODO: Follow up on false future return + for retry := 0; retry < 3; retry++ { + err = m.deleteResources(ctx) + if err == nil { + break + } + m.log.Errorf("Failed to delete %s", err.Error()) + } if err != nil { return err }