Skip to content

Commit

Permalink
Ensure that key is set to target_team in case of membership removal
Browse files Browse the repository at this point in the history
When adding or removing a user from a team you'd need to use target_team instead of team
  • Loading branch information
Marges, RSY (Rick) committed Nov 14, 2023
1 parent d0f7510 commit 303f73b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelogs/fragments/diff_plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
bugfixes:
- Fixed an issue where the usage access to instance_groups were removed
- Fixed an issue where the diff doesn't work correctly when explicitly setting state present
- Fixed member removal of teams
...
4 changes: 4 additions & 0 deletions plugins/lookup/controller_object_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ def run(self, terms, variables=None, **kwargs):
if self.get_option("set_absent"):
for item in difference:
item.update({"state": "absent"})
if 'team' in item and item['role'] == 'member':
item.update({"target_team": item['team']})
item.pop('team')

# Combine Lists
if self.get_option("with_present"):
for item in compare_list_reduced:
Expand Down

0 comments on commit 303f73b

Please sign in to comment.