-
Notifications
You must be signed in to change notification settings - Fork 50
fix: adapt the iam binding update logic to the latest constraints #1838
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
base: main
Are you sure you want to change the base?
Conversation
This is needed as some recent updates to a dependency (google-cloud-resource-manager or its dependencies) broke the existing logic, and we are seeing the error like this: --> policy.bindings.append(new_binding) TypeError: Expected a message object, but got {'role': 'roles/run.invoker', 'members': [...]}
Let's try to update google3 first. That google.iam namespace is indeed problematic |
CC @parthea Did the gapic generator make a breaking change to no longer allow dictionary inputs? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit concerned that this indicates a breaking change happened in the resource manager client library. Please find the change that broke dictionaries. We might need to update our dependencies in setup.py
and the constraints files if this breaking change was intended.
} # Use a dictionary to avoid problematic google.iam namespace package. | ||
new_binding = google.iam.v1.policy_pb2.Binding( | ||
role=role, members=[service_account] | ||
) # Use a dictionary to avoid problematic google.iam namespace package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is now out-of-date.
) # Use a dictionary to avoid problematic google.iam namespace package. | |
) |
Could you try this in google3? I wonder if a //google/iam/v1:iam_policy_py_pb2
dependency was missing last time I tried it?
This is needed as some recent updates to a dependency (google-cloud-resource-manager or its dependencies) broke the existing logic, and we are seeing the error like this:
--> policy.bindings.append(new_binding)
TypeError: Expected a message object, but got {'role': 'roles/run.invoker', 'members': [...]}
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes internal issues 419589974, 425442503 🦕