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 leaked backups #9

Merged
merged 1 commit into from
Oct 30, 2023
Merged

Fix leaked backups #9

merged 1 commit into from
Oct 30, 2023

Conversation

zugao
Copy link
Contributor

@zugao zugao commented Oct 30, 2023

All backups in the cluster are being leaked due to APPCAT-563. Here we make sure to filter out all Custom Resources that do not have an InstanceNamespace. Having an empty InstanceNamespace will leak all backups later on in the business logic.

Checklist

  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog
  • Update tests.

All backups in the cluster are being leaked due to APPCAT-563
@zugao zugao added the bug Something isn't working label Oct 30, 2023
@@ -24,5 +24,16 @@ func (c *concreteRedisProvider) ListVSHNRedis(ctx context.Context, namespace str
return nil, err
}

cleanedList := make([]vshnv1.VSHNRedis, 0)
for _, p := range instances.Items {
Copy link

Choose a reason for hiding this comment

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

Shouldn't this be symetric to the ListXVSHNPostgreSQL() function? Nothing in the method name or docs indicates that this list is filtered by a random field. I would have put it here naively:

snapshots, err := v.snapshothandler.List(ctx, instance.Status.InstanceNamespace)

Also it is never regression tested.

Copy link
Contributor Author

@zugao zugao Oct 30, 2023

Choose a reason for hiding this comment

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

VSHN Redis is helm based and we use the claim and not the XRD.

Regarding regression test, I will check what I can do there. I update the unit tests which covers the logic.

@zugao zugao merged commit 65de476 into master Oct 30, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants