Skip to content
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

Added tracking for deleted namespace status check in restore flow #8233

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sangitaray2021
Copy link

@sangitaray2021 sangitaray2021 commented Sep 20, 2024

Thank you for contributing to Velero!

Please add a summary of your change

Does your change fix a particular issue?

Fixes #8234

Please indicate you've done the following:

@anshulahuja98
Copy link
Collaborator

For - #8234

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 59.23%. Comparing base (3f9c2dc) to head (963e878).
Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
pkg/util/kube/namespace_deletionstatus_tracker.go 76.47% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8233      +/-   ##
==========================================
+ Coverage   59.15%   59.23%   +0.08%     
==========================================
  Files         367      368       +1     
  Lines       30777    30868      +91     
==========================================
+ Hits        18206    18285      +79     
- Misses      11113    11123      +10     
- Partials     1458     1460       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@kaovilai kaovilai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add changelog and run linter.

@reasonerjt
Copy link
Contributor

Given we've reached FC and this may impact the restore flow, let's hold this one until the branch is cut for v1.15

@sangitaray2021 sangitaray2021 force-pushed the fixrestore_ns branch 3 times, most recently from 72d3b56 to c63dd9b Compare September 26, 2024 07:28
Signed-off-by: sangitaray2021 <sangitaray@microsoft.com>

fixed unittest

Signed-off-by: sangitaray2021 <sangitaray@microsoft.com>

refactored tracker execution and caller

Signed-off-by: sangitaray2021 <sangitaray@microsoft.com>

added change log

Signed-off-by: sangitaray2021 <sangitaray@microsoft.com>

Author:    sangitaray2021 <sangitaray@microsft.com>

Author:    sangitaray2021 <sangitaray@microsoft.com>
Date:      Thu Sep 19 02:26:14 2024 +0530
Signed-off-by: sangitaray2021 <sangitaray@microsoft.com>
Signed-off-by: sangitaray2021 <sangitaray@microsoft.com>
@anshulahuja98
Copy link
Collaborator

@kaovilai can you help review the PR?

Copy link
Contributor

@kaovilai kaovilai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC from reviewing, this change reduce potential duplicate await on if namespace exists (wait for 10 min polling) to just one instance per restore. Is that correct?

It's not meant to add polling until deletion is complete to resume some other process?

@sangitaray2021
Copy link
Author

IIUC from reviewing, this change reduce potential duplicate await on if namespace exists (wait for 10 min polling) to just one instance per restore. Is that correct?

It's not meant to add polling until deletion is complete to resume some other process?

yes thats correct. We are reducing duplicate wait by caching the namespace which is under deletion.

Comment on lines +27 to +34
type NamespaceDeletionStatusTracker interface {
// Add informs the tracker that a polling is in progress to check namespace deletion status.
Add(ns, name string)
// Delete informs the tracker that a namespace deletion is completed.
Delete(ns, name string)
// Contains returns true if the tracker is tracking the namespace deletion progress.
Contains(ns, name string) bool
}
Copy link
Contributor

@kaovilai kaovilai Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are there both ns and name parameters?
What purpose does that serve other than duplicate value params?

Is this interface meant to be more generic? Perhaps namespaceDeletionStatusTrackerKey(ns, name) was meant to be more like resourceDeletionStatusTrackerKey(kind, ns, name string) string ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terminating namespace polling for each resource during restore
4 participants