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

fix: Unmanage app on agent on deletion event #301

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

Conversation

jannfis
Copy link
Collaborator

@jannfis jannfis commented Feb 12, 2025

What does this PR do / why we need it:

When an app is deleted on the agent, it was not unmanaged. That prevented the agent from creating a new app with the same name again.

In addition, this PR adds unit tests for the agent's informer callbacks.

Which issue(s) this PR fixes:

Fixes #?

How to test changes / Special notes to the reviewer:

Checklist

  • Documentation update is required by this PR (and has been updated) OR no documentation update is required.

@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 49.65%. Comparing base (cd3dc15) to head (7085387).

Files with missing lines Patch % Lines
pkg/client/remote.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #301      +/-   ##
==========================================
+ Coverage   48.79%   49.65%   +0.85%     
==========================================
  Files          73       73              
  Lines        6400     6404       +4     
==========================================
+ Hits         3123     3180      +57     
+ Misses       3017     2959      -58     
- Partials      260      265       +5     

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

Copy link
Collaborator

@anandf anandf left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -97,7 +97,9 @@ func (a *Agent) addAppDeletionToQueue(app *v1alpha1.Application) {
logCtx.Debugf("Delete app event")

if !a.appManager.IsManaged(app.QualifiedName()) {
logCtx.Tracef("App is not managed")
logCtx.Tracef("App is not managed, proceeding anyways")
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: logCtx.Trace can be used as there are no format specifiers.

Copy link
Collaborator

@chetan-rns chetan-rns left a comment

Choose a reason for hiding this comment

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

LGTM

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

Successfully merging this pull request may close these issues.

4 participants