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

Handle filtering by name and minor exceptions #2

Merged
merged 3 commits into from
Oct 22, 2023

Conversation

kubealex
Copy link
Contributor

hi @sabre1041, first of all thank you for your effort, with this PR I would like to address some issues I faced:

  • There's a failure when using "name" as a parameter due to python kubernetes-client returning a named object [1]. Unfortunately the PR with the fix is not yet merged, so I introduced the following changes:

[v] Add the name as a field_selector, appending it if there are other selectors.
[v] Since the "name" parameter is handled differently, I removed it from the list when enriching the client options

  • Wrapped the event loop in a try/catch to handle generic connectivity exceptions (API server unavailability, etc) to avoid the rulebook to exit

  • Added the field_selectors documentation in the README

Now the flow is smooth, I tested it the whole morning with different combinations and kept it running, and it's still working like a charm.

Hope this is useful,
Ale

[1] kubernetes-client/python#2076

Copy link
Owner

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @kubealex !

Copy link
Owner

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

welp... jumped the gun (gotta love CI). Can you take a look at the errors?

@kubealex
Copy link
Contributor Author

kubealex commented Oct 22, 2023

done @sabre1041, thank you! They were not strictly linked to the code, to summarize, they were related to ansible-lint complaining about:

  • Missing CHANGELOG.md, I added an empty one.
  • Ansible-core version in runtime.yml was 2.11, minimum supported version according to ansible-lint is 2.13.0 [1] so I edited that accordingly.

I also bumped the version to 1.0.1 in galaxy.yml to avoid the release workflow failing due to duplicated versions (feel free to edit that based on how you want to version this) and squashed my commits to clearly identify the different fixes.

[1] https://github.com/ansible/ansible-lint/blob/main/src/ansiblelint/rules/meta_runtime.md

Copy link
Owner

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

LGTM

@sabre1041 sabre1041 merged commit b2fe64d into sabre1041:main Oct 22, 2023
2 checks passed
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.

2 participants