Add Checks for Fleet Existence During Application Deletion#605
Add Checks for Fleet Existence During Application Deletion#605LiZhenCheng9527 wants to merge 3 commits intokurator-dev:mainfrom
Conversation
Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kurator-dev canceled.
|
c7b78c3 to
e41991f
Compare
| func (a *ApplicationManager) reconcileDelete(ctx context.Context, app *applicationapi.Application) (ctrl.Result, error) { | ||
| fleetKey := generateFleetKey(app) | ||
| fleet := &fleetapi.Fleet{} | ||
| if err := a.Client.Get(ctx, fleetKey, fleet); err == nil { |
There was a problem hiding this comment.
we should log error when the error is not found, for other errors we should retry.
There was a problem hiding this comment.
if the application does not need to delete resources in member cluster, we may skip this ops
6b37b4e to
4acac35
Compare
3ed0a26 to
85b4aac
Compare
Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
85b4aac to
f765001
Compare
| fleetKey := generateFleetKey(app) | ||
| fleet := &fleetapi.Fleet{} | ||
| if err := a.Client.Get(ctx, fleetKey, fleet); err != nil { | ||
| log.Error(err, "failed to find fleet", "fleet", fleetKey) |
There was a problem hiding this comment.
please check network / server error, and return
Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
| if apierrors.IsNotFound(err) { | ||
| log.Info("fleet does not exist", "fleet", fleetKey) | ||
| } | ||
| log.Info("failed to get fleet", "fleet", fleetKey, "error", err) |
There was a problem hiding this comment.
not right. You should return only for this error.
What type of PR is this?
/kind feature
What this PR does / why we need it:
Add Checks for Fleet Existence During Application Deletion
Which issue(s) this PR fixes:
Fixes #604