Skip to content

Commit 3511ad0

Browse files
authored
{ACS} az aks create: Revert the changes to make --no-ssh-key default behaviour (#32231)
1 parent b2b7c33 commit 3511ad0

File tree

4 files changed

+3
-871
lines changed

4 files changed

+3
-871
lines changed

src/azure-cli/azure/cli/command_modules/acs/_help.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@
9595
- name: --ssh-key-value
9696
type: string
9797
short-summary: Public key path or key contents to install on node VMs for SSH access. For example, 'ssh-rsa AAAAB...snip...UcyupgH azureuser@linuxvm'.
98-
long-summary: |-
99-
If omitted:
100-
- The CLI will use '~/.ssh/id_rsa.pub' when present
101-
- If that file is not present the CLI will default to server-side generated keys (equivalent to using --no-ssh-key)
10298
- name: --admin-username -u
10399
type: string
104100
short-summary: User account to create on node VMs for SSH access.
@@ -267,7 +263,7 @@
267263
- name: --no-ssh-key -x
268264
type: string
269265
short-summary: Do not use or create a local SSH key.
270-
long-summary: If omitted and no local public key exists, the CLI will default to this behavior. To access nodes after creating a cluster with this option, use the Azure Portal.
266+
long-summary: To access nodes after creating a cluster with this option, use the Azure Portal.
271267
- name: --pod-cidr
272268
type: string
273269
short-summary: A CIDR notation IP range from which to assign pod IPs when Azure CNI Overlay or Kubenet is used (On 31 March 2028, Kubenet will be retired).

src/azure-cli/azure/cli/command_modules/acs/_validators.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,8 @@ def validate_ssh_key(namespace):
6565
"file share, back up your keys to a safe location",
6666
private_key_filepath, public_key_filepath)
6767
else:
68-
if (not content or str(content).strip() == "" or
69-
(content == os.path.join(os.path.expanduser('~'), '.ssh', 'id_rsa.pub'))):
70-
namespace.no_ssh_key = True
71-
return
72-
raise CLIError(
73-
"The SSH key provided is not a valid RSA public key. "
74-
"Provide the contents of a valid SSH public key (for example, '~/.ssh/id_rsa.pub'), "
75-
"specify a path to a public key file, "
76-
"or add --generate-ssh-keys as a parameter to create a new key pair."
77-
)
68+
raise CLIError('An RSA key file or key value must be supplied to SSH Key Value. '
69+
'You can use --generate-ssh-keys to let CLI generate one for you')
7870
namespace.ssh_key_value = content
7971

8072

0 commit comments

Comments
 (0)