Skip to content

Commit

Permalink
{AKS} Sort out test cases (Azure#22033)
Browse files Browse the repository at this point in the history
  • Loading branch information
FumingZhang authored Apr 13, 2022
1 parent b717f42 commit f358348
Show file tree
Hide file tree
Showing 13 changed files with 6,904 additions and 13,887 deletions.
168 changes: 90 additions & 78 deletions src/azure-cli/azure/cli/command_modules/acs/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,52 +207,27 @@ def load_arguments(self, _):
c.argument('tags', tags_type)

with self.argument_context('aks create', resource_type=ResourceType.MGMT_CONTAINERSERVICE, operation_group='managed_clusters') as c:
# nodepool paramerters
c.argument('nodepool_name', default='nodepool1',
help='Node pool name, up to 12 alphanumeric characters', validator=validate_nodepool_name)
c.argument('node_vm_size', options_list=['--node-vm-size', '-s'], completer=get_vm_size_completion_list)
c.argument('os_sku', arg_type=get_enum_type(node_os_skus))
c.argument('vnet_subnet_id', validator=validate_vnet_subnet_id)
c.argument('pod_subnet_id', validator=validate_pod_subnet_id)
c.argument('enable_node_public_ip', action='store_true')
c.argument('node_public_ip_prefix_id')
c.argument('enable_cluster_autoscaler', action='store_true')
c.argument('min_count', type=int, validator=validate_nodes_count)
c.argument('max_count', type=int, validator=validate_nodes_count)
c.argument('nodepool_tags', nargs='*', validator=validate_nodepool_tags,
help='space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.')
c.argument('nodepool_labels', nargs='*', validator=validate_nodepool_labels,
help='space-separated labels: key[=value] [key[=value] ...]. See https://aka.ms/node-labels for syntax of labels.')
c.argument('node_osdisk_type', arg_type=get_enum_type(node_os_disk_types))
c.argument('node_osdisk_size', type=int)
c.argument('max_pods', type=int, options_list=['--max-pods', '-m'])
c.argument('vm_set_type', validator=validate_vm_set_type)
c.argument('zones', zones_type, options_list=['--zones', '-z'], help='Space-separated list of availability zones where agent nodes will be placed.')
c.argument('ppg', validator=validate_ppg)
c.argument('enable_encryption_at_host', action='store_true')
c.argument('enable_ultra_ssd', action='store_true')
c.argument('enable_fips_image', action='store_true')
c.argument('snapshot_id', validator=validate_snapshot_id)
c.argument('kubelet_config')
c.argument('linux_os_config')
# managed cluster paramerters
c.argument('name', validator=validate_linux_host_name)
c.argument('kubernetes_version',
completer=get_k8s_versions_completion_list)
c.argument('admin_username', options_list=[
'--admin-username', '-u'], default='azureuser')
c.argument('dns_name_prefix', options_list=['--dns-name-prefix', '-p'])
c.argument('generate_ssh_keys', action='store_true',
validator=validate_create_parameters)
c.argument('ssh_key_value', required=False, type=file_type, default=os.path.join('~', '.ssh', 'id_rsa.pub'),
completer=FilesCompleter(), validator=validate_ssh_key)
c.argument('aad_client_app_id')
c.argument('aad_server_app_id')
c.argument('aad_server_app_secret')
c.argument('aad_tenant_id')
c.argument('no_ssh_key', options_list=['--no-ssh-key', '-x'])
c.argument('edge_zone', edge_zone_type)
c.argument('node_osdisk_diskencryptionset_id', options_list=['--node-osdisk-diskencryptionset-id', '-d'])
c.argument('disable_local_accounts', action='store_true')
c.argument('disable_rbac', action='store_true')
c.argument('enable_rbac', action='store_true', options_list=['--enable-rbac', '-r'],
deprecate_info=c.deprecate(redirect="--disable-rbac", hide="2.0.45"))
c.argument('dns_service_ip')
c.argument('docker_bridge_address')
c.argument('edge_zone', edge_zone_type)
c.argument('pod_cidr')
c.argument('service_cidr')
c.argument('load_balancer_sku', validator=validate_load_balancer_sku)
c.argument('load_balancer_managed_outbound_ip_count', type=int)
c.argument('load_balancer_outbound_ips', validator=validate_load_balancer_outbound_ips)
Expand All @@ -264,68 +239,86 @@ def load_arguments(self, _):
c.argument('nat_gateway_idle_timeout', type=int,
validator=validate_nat_gateway_idle_timeout)
c.argument('outbound_type', arg_type=get_enum_type(outbound_types))
c.argument('network_plugin', arg_type=get_enum_type(network_plugins))
c.argument('network_policy')
c.argument('auto_upgrade_channel', arg_type=get_enum_type(auto_upgrade_channels))
c.argument('cluster_autoscaler_profile', nargs='+', options_list=["--cluster-autoscaler-profile", "--ca-profile"],
help="Space-separated list of key=value pairs for configuring cluster autoscaler. Pass an empty string to clear the profile.")
c.argument('uptime_sla', action='store_true')
c.argument('enable_addons', options_list=['--enable-addons', '-a'])
c.argument('disable_rbac', action='store_true')
c.argument('enable_rbac', action='store_true', options_list=['--enable-rbac', '-r'],
deprecate_info=c.deprecate(redirect="--disable-rbac", hide="2.0.45"))
c.argument('network_plugin', arg_type=get_enum_type(network_plugins))
c.argument('network_policy')
c.argument('no_ssh_key', options_list=['--no-ssh-key', '-x'])
c.argument('pod_cidr')
c.argument('service_cidr')
c.argument('workspace_resource_id')
c.argument('enable_msi_auth_for_monitoring', arg_type=get_three_state_flag(), is_preview=True)
c.argument('skip_subnet_role_assignment', action='store_true')
c.argument('dns_name_prefix', options_list=['--dns-name-prefix', '-p'])
c.argument('fqdn_subdomain')
c.argument('api_server_authorized_ip_ranges', validator=validate_ip_ranges)
c.argument('attach_acr', acr_arg_type)
c.argument('enable_private_cluster', action='store_true')
c.argument('private_dns_zone')
c.argument('fqdn_subdomain')
c.argument('disable_public_fqdn', action='store_true')
c.argument('service_principal')
c.argument('client_secret')
c.argument('enable_managed_identity', action='store_true')
c.argument('assign_identity', validator=validate_assign_identity)
c.argument('assign_kubelet_identity', validator=validate_assign_kubelet_identity)
c.argument('enable_aad', action='store_true')
c.argument('enable_azure_rbac', action='store_true')
c.argument('aad_client_app_id')
c.argument('aad_server_app_id')
c.argument('aad_server_app_secret')
c.argument('aad_tenant_id')
c.argument('aad_admin_group_object_ids')
c.argument('windows_admin_username')
c.argument('windows_admin_password')
c.argument('enable_ahub', action='store_true')
c.argument('node_osdisk_diskencryptionset_id', options_list=['--node-osdisk-diskencryptionset-id', '-d'])
c.argument('enable_windows_gmsa', action='store_true')
c.argument('gmsa_dns_server')
c.argument('gmsa_root_domain_name')
c.argument('attach_acr', acr_arg_type)
c.argument('skip_subnet_role_assignment', action='store_true')
# addons
c.argument('enable_addons', options_list=['--enable-addons', '-a'])
c.argument('workspace_resource_id')
c.argument('enable_msi_auth_for_monitoring', arg_type=get_three_state_flag(), is_preview=True)
c.argument('aci_subnet_name')
c.argument('appgw_name', arg_group='Application Gateway')
c.argument('appgw_subnet_cidr', arg_group='Application Gateway')
c.argument('appgw_id', arg_group='Application Gateway')
c.argument('appgw_subnet_id', arg_group='Application Gateway')
c.argument('appgw_watch_namespace', arg_group='Application Gateway')
c.argument('assign_kubelet_identity', validator=validate_assign_kubelet_identity)
c.argument('disable_local_accounts', action='store_true')
c.argument('enable_secret_rotation', action='store_true')
c.argument('rotation_poll_interval')
c.argument('enable_windows_gmsa', action='store_true')
c.argument('gmsa_dns_server')
c.argument('gmsa_root_domain_name')
c.argument('enable_sgxquotehelper', action='store_true')
c.argument('yes', options_list=[
'--yes', '-y'], help='Do not prompt for confirmation.', action='store_true')

with self.argument_context('aks update') as c:
# nodepool paramerters
c.argument('enable_cluster_autoscaler', options_list=[
"--enable-cluster-autoscaler", "-e"], action='store_true')
c.argument('disable_cluster_autoscaler', options_list=[
"--disable-cluster-autoscaler", "-d"], action='store_true')
c.argument('update_cluster_autoscaler', options_list=[
"--update-cluster-autoscaler", "-u"], action='store_true')
c.argument('nodepool_name', default='nodepool1',
help='Node pool name, up to 12 alphanumeric characters', validator=validate_nodepool_name)
c.argument('node_vm_size', options_list=['--node-vm-size', '-s'], completer=get_vm_size_completion_list)
c.argument('os_sku', arg_type=get_enum_type(node_os_skus))
c.argument('vnet_subnet_id', validator=validate_vnet_subnet_id)
c.argument('pod_subnet_id', validator=validate_pod_subnet_id)
c.argument('enable_node_public_ip', action='store_true')
c.argument('node_public_ip_prefix_id')
c.argument('enable_cluster_autoscaler', action='store_true')
c.argument('min_count', type=int, validator=validate_nodes_count)
c.argument('max_count', type=int, validator=validate_nodes_count)
c.argument('nodepool_tags', nargs='*', validator=validate_nodepool_tags,
help='space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.')
c.argument('nodepool_labels', nargs='*', validator=validate_nodepool_labels,
help='space-separated labels: key[=value] [key[=value] ...]. See https://aka.ms/node-labels for syntax of labels.')
c.argument('node_osdisk_type', arg_type=get_enum_type(node_os_disk_types))
c.argument('node_osdisk_size', type=int)
c.argument('max_pods', type=int, options_list=['--max-pods', '-m'])
c.argument('vm_set_type', validator=validate_vm_set_type)
c.argument('zones', zones_type, options_list=['--zones', '-z'], help='Space-separated list of availability zones where agent nodes will be placed.')
c.argument('ppg', validator=validate_ppg)
c.argument('enable_encryption_at_host', action='store_true')
c.argument('enable_ultra_ssd', action='store_true')
c.argument('enable_fips_image', action='store_true')
c.argument('snapshot_id', validator=validate_snapshot_id)
c.argument('kubelet_config')
c.argument('linux_os_config')
c.argument('yes', options_list=[
'--yes', '-y'], help='Do not prompt for confirmation.', action='store_true')

with self.argument_context('aks update') as c:
# managed cluster paramerters
c.argument('cluster_autoscaler_profile', nargs='+', options_list=["--cluster-autoscaler-profile", "--ca-profile"],
help="Space-separated list of key=value pairs for configuring cluster autoscaler. Pass an empty string to clear the profile.")
c.argument('uptime_sla', action='store_true')
c.argument('no_uptime_sla', action='store_true')
c.argument('disable_local_accounts', action='store_true')
c.argument('enable_local_accounts', action='store_true')
c.argument('load_balancer_managed_outbound_ip_count', type=int)
c.argument('load_balancer_outbound_ips', validator=validate_load_balancer_outbound_ips)
c.argument('load_balancer_outbound_ip_prefixes', validator=validate_load_balancer_outbound_ip_prefixes)
Expand All @@ -334,24 +327,43 @@ def load_arguments(self, _):
c.argument('nat_gateway_managed_outbound_ip_count', type=int, validator=validate_nat_gateway_managed_outbound_ip_count)
c.argument('nat_gateway_idle_timeout', type=int, validator=validate_nat_gateway_idle_timeout)
c.argument('auto_upgrade_channel', arg_type=get_enum_type(auto_upgrade_channels))
c.argument('cluster_autoscaler_profile', nargs='+', options_list=["--cluster-autoscaler-profile", "--ca-profile"],
help="Space-separated list of key=value pairs for configuring cluster autoscaler. Pass an empty string to clear the profile.")
c.argument('uptime_sla', action='store_true')
c.argument('no_uptime_sla', action='store_true')
c.argument('api_server_authorized_ip_ranges', validator=validate_ip_ranges)
c.argument('attach_acr', acr_arg_type, validator=validate_acr)
c.argument('detach_acr', acr_arg_type, validator=validate_acr)
c.argument('enable_ahub', action='store_true')
c.argument('disable_ahub', action='store_true')
c.argument('enable_public_fqdn', action='store_true')
c.argument('disable_public_fqdn', action='store_true')
c.argument('windows_admin_password')
c.argument('enable_managed_identity', action='store_true')
c.argument('assign_identity', validator=validate_assign_identity)
c.argument('disable_local_accounts', action='store_true')
c.argument('enable_local_accounts', action='store_true')
c.argument('enable_secret_rotation', action='store_true')
c.argument('disable_secret_rotation', action='store_true')
c.argument('rotation_poll_interval')
c.argument('enable_aad', action='store_true')
c.argument('enable_azure_rbac', action='store_true')
c.argument('disable_azure_rbac', action='store_true')
c.argument('aad_tenant_id')
c.argument('aad_admin_group_object_ids')
c.argument('windows_admin_password')
c.argument('enable_ahub', action='store_true')
c.argument('disable_ahub', action='store_true')
c.argument('enable_windows_gmsa', action='store_true')
c.argument('gmsa_dns_server')
c.argument('gmsa_root_domain_name')
c.argument('attach_acr', acr_arg_type, validator=validate_acr)
c.argument('detach_acr', acr_arg_type, validator=validate_acr)
# addons
c.argument('enable_secret_rotation', action='store_true')
c.argument('disable_secret_rotation', action='store_true')
c.argument('rotation_poll_interval')
# nodepool paramerters
c.argument('enable_cluster_autoscaler', options_list=[
"--enable-cluster-autoscaler", "-e"], action='store_true')
c.argument('disable_cluster_autoscaler', options_list=[
"--disable-cluster-autoscaler", "-d"], action='store_true')
c.argument('update_cluster_autoscaler', options_list=[
"--update-cluster-autoscaler", "-u"], action='store_true')
c.argument('min_count', type=int, validator=validate_nodes_count)
c.argument('max_count', type=int, validator=validate_nodes_count)
c.argument('nodepool_labels', nargs='*', validator=validate_nodepool_labels,
help='space-separated labels: key[=value] [key[=value] ...]. See https://aka.ms/node-labels for syntax of labels.')
c.argument('yes', options_list=[
'--yes', '-y'], help='Do not prompt for confirmation.', action='store_true')

Expand Down
Loading

0 comments on commit f358348

Please sign in to comment.