Skip to content

Commit 4030a8e

Browse files
authored
{AKS} Suppress the annoying message if the cluster sku name is automatic (#9019)
* Suppress the annoying message if the cluster sku name is automatic * update logging message and history * code update * use previous code without touching automatic e2e * update comment
1 parent 3ec9a28 commit 4030a8e

File tree

5 files changed

+1936
-1405
lines changed

5 files changed

+1936
-1405
lines changed

src/aks-preview/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ To release a new version, please select a new version number (usually plus 1 to
1212
Pending
1313
+++++++
1414

15+
18.0.0b24
16+
+++++++
17+
* Suppress the ssh access annoying message if the cluster sku name is automatic.
18+
1519
18.0.0b23
1620
+++++++
1721
* `az aks create`: Add new parameter `--disable-run-command` to disable run command feature for the cluster

src/aks-preview/azext_aks_preview/agentpool_decorator.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
CONST_DEFAULT_WINDOWS_NODE_VM_SIZE,
4242
CONST_DEFAULT_VMS_VM_SIZE,
4343
CONST_DEFAULT_WINDOWS_VMS_VM_SIZE,
44+
CONST_MANAGED_CLUSTER_SKU_NAME_AUTOMATIC,
4445
CONST_SSH_ACCESS_LOCALUSER,
4546
CONST_GPU_DRIVER_NONE,
4647
CONST_NODEPOOL_MODE_MANAGEDSYSTEM,
@@ -567,6 +568,9 @@ def get_ssh_access(self) -> Union[str, None]:
567568
"""
568569
return self.raw_param.get("ssh_access")
569570

571+
def get_sku_name(self) -> str:
572+
return self.raw_param.get("sku")
573+
570574
def get_yes(self) -> bool:
571575
"""Obtain the value of yes.
572576
@@ -982,13 +986,19 @@ def set_up_ssh_access(self, agentpool: AgentPool) -> AgentPool:
982986
self._ensure_agentpool(agentpool)
983987

984988
ssh_access = self.context.get_ssh_access()
989+
sku_name = self.context.get_sku_name()
985990
if ssh_access is not None:
986991
if agentpool.security_profile is None:
987992
agentpool.security_profile = self.models.AgentPoolSecurityProfile() # pylint: disable=no-member
988993
agentpool.security_profile.ssh_access = ssh_access
989994
if ssh_access == CONST_SSH_ACCESS_LOCALUSER:
990-
logger.warning("The new node pool will enable SSH access, recommended to use '--ssh-access disabled' "
991-
"option to disable SSH access for the node pool to make it more secure.")
995+
if sku_name == CONST_MANAGED_CLUSTER_SKU_NAME_AUTOMATIC:
996+
logger.warning("SSH access is in preview")
997+
else:
998+
logger.warning(
999+
"The new node pool will enable SSH access, recommended to use "
1000+
"'--ssh-access disabled' option to disable SSH access for the node pool to make it more secure."
1001+
)
9921002
return agentpool
9931003

9941004
def set_up_skip_gpu_driver_install(self, agentpool: AgentPool) -> AgentPool:

0 commit comments

Comments
 (0)