Skip to content

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