-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Checks for Fleet Existence During Application Deletion #605
base: main
Are you sure you want to change the base?
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.
Needs 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should log error when the error is not found, for other errors we should retry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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