Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
norshtein committed Apr 14, 2021
1 parent 394b1d6 commit 9374194
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions linter_exclusions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ aks create:
enable_pod_identity_with_kubenet:
rule_exclusions:
- option_length_too_long
assign_kubelet_identity:
rule_exclusions:
- option_length_too_long
aks enable-addons:
parameters:
appgw_watch_namespace:
Expand Down
5 changes: 4 additions & 1 deletion src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,11 @@ def _get_user_assigned_identity(cli_ctx, resource_id):
def _get_user_assigned_identity_client_id(cli_ctx, resource_id):
return _get_user_assigned_identity(cli_ctx, resource_id).client_id


def _get_user_assigned_identity_object_id(cli_ctx, resource_id):
return _get_user_assigned_identity(cli_ctx, resource_id).principal_id


def _update_dict(dict1, dict2):
cp = dict1.copy()
cp.update(dict2)
Expand Down Expand Up @@ -4098,6 +4100,7 @@ def aks_pod_identity_exception_list(cmd, client, resource_group_name, cluster_na
instance = client.get(resource_group_name, cluster_name)
return _remove_nulls([instance])[0]


def _ensure_cluster_identity_permission_on_kubelet_identity(cli_ctx, cluster_identity_object_id, scope):
managed_identity_operator_role = 'Managed Identity Operator'
managed_identity_operator_role_id = 'f1a07417-d97a-45cb-824c-7a7467783830'
Expand All @@ -4117,4 +4120,4 @@ def _ensure_cluster_identity_permission_on_kubelet_identity(cli_ctx, cluster_ide

if not _add_role_assignment(cli_ctx, managed_identity_operator_role, cluster_identity_object_id,
is_service_principal=False, scope=scope):
raise CLIError('Could not grant Managed Identity Operator permission to cluster identity at scope {}'.format(scope))
raise CLIError('Could not grant Managed Identity Operator permission to cluster identity at scope {}'.format(scope))

0 comments on commit 9374194

Please sign in to comment.