@@ -155,6 +155,11 @@ def _change_cost_data_with_actions(
155
155
source = value ["source" ]
156
156
target_key = value .get ("target" , "service_account_id" )
157
157
target_value = utils .get_dict_value (cost_data , source )
158
+ all_workspaces = value .get ("all_workspaces" , False )
159
+
160
+ if all_workspaces :
161
+ workspace_id = None
162
+
158
163
if target_value :
159
164
service_account_info = self ._get_service_account (
160
165
target_key , target_value , domain_id , workspace_id
@@ -179,11 +184,11 @@ def _get_service_account(
179
184
self , target_key , target_value , domain_id : str , workspace_id : str = None
180
185
):
181
186
if (
182
- f"service-account:{ domain_id } :{ target_key } :{ target_value } "
187
+ f"service-account:{ domain_id } :{ target_key } :{ target_value } : { workspace_id } "
183
188
in self ._service_account_info
184
189
):
185
190
return self ._service_account_info [
186
- f"service-account:{ domain_id } :{ target_key } :{ target_value } "
191
+ f"service-account:{ domain_id } :{ target_key } :{ target_value } : { workspace_id } "
187
192
]
188
193
189
194
query = {
@@ -207,7 +212,7 @@ def _get_service_account(
207
212
service_account_info = results [0 ]
208
213
209
214
self ._service_account_info [
210
- f"service-account:{ domain_id } :{ target_key } :{ target_value } "
215
+ f"service-account:{ domain_id } :{ target_key } :{ target_value } : { workspace_id } "
211
216
] = service_account_info
212
217
return service_account_info
213
218
0 commit comments