Skip to content

Commit

Permalink
Changed flag to enable-azure-rbac instead of aad-enable-azure-rbac
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and Anumita committed Jul 1, 2020
1 parent 3bc868a commit d9d0ca4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
- name: --enable-aad
type: bool
short-summary: Enable managed AAD feature for cluster.
- name: --aad-enable-azure-rbac
- name: --enable-azure-rbac
type: bool
short-summary: Whether to enable Azure RBAC for Kubernetes authorization.
- name: --aad-admin-group-object-ids
Expand Down
40 changes: 20 additions & 20 deletions src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,22 @@
KeyCredential,
ServicePrincipalCreateParameters,
GetObjectsParameters)
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ContainerServiceLinuxProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterWindowsProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ContainerServiceNetworkProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterServicePrincipalProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ContainerServiceSshConfiguration
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ContainerServiceSshPublicKey
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedCluster
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterAADProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterAddonProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterAgentPoolProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import AgentPool
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import AgentPoolUpgradeSettings
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ContainerServiceStorageProfileTypes
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterIdentity
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterAPIServerAccessProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterSKU
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import (ContainerServiceLinuxProfile,
ManagedClusterWindowsProfile,
ContainerServiceNetworkProfile,
ManagedClusterServicePrincipalProfile,
ContainerServiceSshConfiguration,
ContainerServiceSshPublicKey,
ManagedCluster,
ManagedClusterAADProfile,
ManagedClusterAddonProfile,
ManagedClusterAgentPoolProfile,
AgentPool,
AgentPoolUpgradeSettings,
ContainerServiceStorageProfileTypes,
ManagedClusterIdentity,
ManagedClusterAPIServerAccessProfile,
ManagedClusterSKU)
from ._client_factory import cf_resource_groups
from ._client_factory import get_auth_management_client
from ._client_factory import get_graph_rbac_management_client
Expand Down Expand Up @@ -809,7 +809,7 @@ def aks_create(cmd, # pylint: disable=too-many-locals,too-many-statements,to
appgw_subnet_id=None,
appgw_watch_namespace=None,
enable_aad=False,
aad_enable_azure_rbac=False,
enable_azure_rbac=False,
aad_admin_group_object_ids=None,
no_wait=False):
if not no_ssh_key:
Expand Down Expand Up @@ -983,16 +983,16 @@ def aks_create(cmd, # pylint: disable=too-many-locals,too-many-statements,to

aad_profile = ManagedClusterAADProfile(
managed=True,
enable_azure_rbac=aad_enable_azure_rbac,
enable_azure_rbac=enable_azure_rbac,
admin_group_object_ids=_parse_comma_separated_list(aad_admin_group_object_ids),
tenant_id=aad_tenant_id
)
else:
if aad_admin_group_object_ids is not None:
raise CLIError('"--admin-aad-object-id" can only be used together with "--enable-aad"')

if aad_enable_azure_rbac is True:
raise CLIError('"--enable_azure_rbac" can only be used together with "--enable-aad"')
if enable_azure_rbac is True:
raise CLIError('"--enable-azure-rbac" can only be used together with "--enable-aad"')

if any([aad_client_app_id, aad_server_app_id, aad_server_app_secret]):
aad_profile = ManagedClusterAADProfile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interactions:
Connection:
- keep-alive
ParameterSetName:
- --resource-group --name --vm-set-type -c --enable-aad --aad-enable-azure-rbac --aad-admin-group-object-ids
- --resource-group --name --vm-set-type -c --enable-aad --enable-azure-rbac --aad-admin-group-object-ids
User-Agent:
- python/3.6.9 (Linux-4.19.104-microsoft-standard-x86_64-with-Ubuntu-18.04-bionic)
msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/9.0.0 Azure-SDK-For-Python
Expand Down Expand Up @@ -149,7 +149,7 @@ interactions:
Connection:
- keep-alive
ParameterSetName:
- --resource-group --name --vm-set-type -c --enable-aad --aad-enable-azure-rbac --aad-admin-group-object-ids
- --resource-group --name --vm-set-type -c --enable-aad --enable-azure-rbac --aad-admin-group-object-ids
User-Agent:
- python/3.6.9 (Linux-4.19.104-microsoft-standard-x86_64-with-Ubuntu-18.04-bionic)
msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-containerservice/4.4.3 Azure-SDK-For-Python
Expand Down Expand Up @@ -198,7 +198,7 @@ interactions:
Connection:
- keep-alive
ParameterSetName:
- --resource-group --name --vm-set-type -c --enable-aad --aad-enable-azure-rbac --aad-admin-group-object-ids
- --resource-group --name --vm-set-type -c --enable-aad --enable-azure-rbac --aad-admin-group-object-ids
User-Agent:
- python/3.6.9 (Linux-4.19.104-microsoft-standard-x86_64-with-Ubuntu-18.04-bionic)
msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-containerservice/4.4.3 Azure-SDK-For-Python
Expand Down Expand Up @@ -247,7 +247,7 @@ interactions:
Connection:
- keep-alive
ParameterSetName:
- --resource-group --name --vm-set-type -c --enable-aad --aad-enable-azure-rbac --aad-admin-group-object-ids
- --resource-group --name --vm-set-type -c --enable-aad --enable-azure-rbac --aad-admin-group-object-ids
User-Agent:
- python/3.6.9 (Linux-4.19.104-microsoft-standard-x86_64-with-Ubuntu-18.04-bionic)
msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-containerservice/4.4.3 Azure-SDK-For-Python
Expand Down Expand Up @@ -296,7 +296,7 @@ interactions:
Connection:
- keep-alive
ParameterSetName:
- --resource-group --name --vm-set-type -c --enable-aad --aad-enable-azure-rbac --aad-admin-group-object-ids
- --resource-group --name --vm-set-type -c --enable-aad --enable-azure-rbac --aad-admin-group-object-ids
User-Agent:
- python/3.6.9 (Linux-4.19.104-microsoft-standard-x86_64-with-Ubuntu-18.04-bionic)
msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-containerservice/4.4.3 Azure-SDK-For-Python
Expand Down Expand Up @@ -345,7 +345,7 @@ interactions:
Connection:
- keep-alive
ParameterSetName:
- --resource-group --name --vm-set-type -c --enable-aad --aad-enable-azure-rbac --aad-admin-group-object-ids
- --resource-group --name --vm-set-type -c --enable-aad --enable-azure-rbac --aad-admin-group-object-ids
User-Agent:
- python/3.6.9 (Linux-4.19.104-microsoft-standard-x86_64-with-Ubuntu-18.04-bionic)
msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-containerservice/4.4.3 Azure-SDK-For-Python
Expand Down Expand Up @@ -394,7 +394,7 @@ interactions:
Connection:
- keep-alive
ParameterSetName:
- --resource-group --name --vm-set-type -c --enable-aad --aad-enable-azure-rbac --aad-admin-group-object-ids
- --resource-group --name --vm-set-type -c --enable-aad --enable-azure-rbac --aad-admin-group-object-ids
User-Agent:
- python/3.6.9 (Linux-4.19.104-microsoft-standard-x86_64-with-Ubuntu-18.04-bionic)
msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-containerservice/4.4.3 Azure-SDK-For-Python
Expand Down Expand Up @@ -443,7 +443,7 @@ interactions:
Connection:
- keep-alive
ParameterSetName:
- --resource-group --name --vm-set-type -c --enable-aad --aad-enable-azure-rbac --aad-admin-group-object-ids
- --resource-group --name --vm-set-type -c --enable-aad --enable-azure-rbac --aad-admin-group-object-ids
User-Agent:
- python/3.6.9 (Linux-4.19.104-microsoft-standard-x86_64-with-Ubuntu-18.04-bionic)
msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-containerservice/4.4.3 Azure-SDK-For-Python
Expand Down Expand Up @@ -493,7 +493,7 @@ interactions:
Connection:
- keep-alive
ParameterSetName:
- --resource-group --name --vm-set-type -c --enable-aad --aad-enable-azure-rbac --aad-admin-group-object-ids
- --resource-group --name --vm-set-type -c --enable-aad --enable-azure-rbac --aad-admin-group-object-ids
User-Agent:
- python/3.6.9 (Linux-4.19.104-microsoft-standard-x86_64-with-Ubuntu-18.04-bionic)
msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-containerservice/4.4.3 Azure-SDK-For-Python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def test_aks_create_and_update_with_managed_aad_enable_azure_rbac(self, resource

create_cmd = 'aks create --resource-group={resource_group} --name={name} ' \
'--vm-set-type AvailabilitySet -c 1 ' \
'--enable-aad --aad-enable-azure-rbac --aad-admin-group-object-ids 00000000-0000-0000-0000-000000000001 -o json'
'--enable-aad --enable-azure-rbac --aad-admin-group-object-ids 00000000-0000-0000-0000-000000000001 -o json'
self.cmd(create_cmd, checks=[
self.check('provisioningState', 'Succeeded'),
self.check('aadProfile.managed', True),
Expand Down

0 comments on commit d9d0ca4

Please sign in to comment.