Skip to content

Handle situations when we cannot collect or list particular resource(s) #101

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

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

im-konge
Copy link
Member

@im-konge im-konge commented Jun 7, 2024

Description

This PR adds additional method that handles execution of the collect/list/describe methods and their error handling. In situations when LogCollector lists the resources for particular type and gets the full list of names, it then tries to collect YAMLs for each of the resource in that list. However, in case that the resource was deleted in the meantime, it fails with the exception that particular resource with name in Namespace doesn't exist, failing the whole LogCollector and the collection of the data.

This execution method takes lambda with the method that should be executed and, in case that there is some exception, it just logs that it couldn't collect the stuff, because of the issue, but stays up and tries to collect other resources.

Fixes #98

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit/integration tests pass locally with my changes

@im-konge im-konge self-assigned this Jun 7, 2024
@github-actions github-actions bot requested review from Frawless and kornys June 7, 2024 08:50
@kornys kornys merged commit 468ff56 into main Jun 7, 2024
6 checks passed
@kornys kornys deleted the fix-exceptions branch June 7, 2024 17:10
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.

[Bug]: LogCollector fail when resource is not present in the namesapce
3 participants