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

Use parameter for involved_obj["apiVersion"] #45

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

Conversation

MrBasset
Copy link

I noticed that the apiVersion for the involved object had been hard coded to v1; I found that for CR's where the ApiVersion was different I would get an error thrown on line 282 as 281 returned true but there was no .get attribute on the resource list.

My python skills aren't that great, so I'm not sure how 280 needs to be modified to fix the test though; testing the attribute exists seems a bit clunky though.

Fix issue where involved_object without v1 apiVersion cannot be found
@piec
Copy link

piec commented Oct 30, 2023

@MrBasset actually involved_obj.get("apiVersion", "v1") means get involved_obj["apiVersion"] and fallback to "v1" if it's not defined. See the .get() function of python dicts.

I'm not part of the project but the original code looks ok to me.

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