Skip to content

Commit 795c65d

Browse files
committed
Suppress the annoying message if the cluster sku name is automatic
1 parent 55e6dbd commit 795c65d

File tree

3 files changed

+2050
-1474
lines changed

3 files changed

+2050
-1474
lines changed

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("--disable-ssh is in preview by the time automatic is GA")
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)