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

Add Backup warning for inclusion of NS managed by ArgoCD #8257

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shubham-pampattiwar
Copy link
Collaborator

Thank you for contributing to Velero!

Please add a summary of your change

This change adds a warning to velero backup operation if there are namespaces included in the backup which are managed by ArgoCD.

We’ve observed conflicts between Velero and ArgoCD in such environments and produce undesirable outcomes. This backup warning serves as a notification to ensure users are aware of the potential problems.

Does your change fix a particular issue?

Fix Related to #7905

Please indicate you've done the following:

Copy link

codecov bot commented Oct 1, 2024

Codecov Report

Attention: Patch coverage is 64.28571% with 5 lines in your changes missing coverage. Please review.

Project coverage is 59.19%. Comparing base (42de654) to head (272b77e).

Files with missing lines Patch % Lines
pkg/backup/backup.go 64.28% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8257      +/-   ##
==========================================
- Coverage   59.21%   59.19%   -0.02%     
==========================================
  Files         367      367              
  Lines       30841    30855      +14     
==========================================
+ Hits        18262    18265       +3     
- Misses      11119    11128       +9     
- Partials     1460     1462       +2     

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

}

nsLabels := ns.GetLabels()
if len(nsLabels[ArgoCDManagedByNamespaceLabel]) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we check if label exist here instead of checking if its value is not an empty string?

Copy link
Contributor

Choose a reason for hiding this comment

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

That would probably be better.. as long as we know it is possible label only need key and empty value is ok

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The rationale here is the having an empty value for the ArgoCD label key would not make much sense, so this acts as a additional check.

Copy link
Contributor

Choose a reason for hiding this comment

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

While it may not make sense, we need to match whatever argocd logic is regarding namespace it manages. If it disallows empty value label then current code is fine.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>

add changelog file

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>

run make update

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>

re-position import

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>

update argo cd label comment

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
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.

3 participants