Skip to content

Commit 6c21ed9

Browse files
authored
{AKS} Refactor code to suppress ssh access warning message when creating an automatic cluster (#9092)
1 parent 37358a1 commit 6c21ed9

6 files changed

Lines changed: 1135 additions & 1361 deletions

File tree

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.0b29
16+
+++++++
17+
* Refactor code to suppress ssh access warning message when creating an automatic cluster.
18+
1519
18.0.0b28
1620
+++++++
1721
* Add interactive AI-powered debugging tool `az aks agent`.

src/aks-preview/azext_aks_preview/agentpool_decorator.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -987,18 +987,17 @@ def set_up_ssh_access(self, agentpool: AgentPool) -> AgentPool:
987987

988988
ssh_access = self.context.get_ssh_access()
989989
sku_name = self.context.get_sku_name()
990+
if sku_name and sku_name.lower() == CONST_MANAGED_CLUSTER_SKU_NAME_AUTOMATIC:
991+
return agentpool
990992
if ssh_access is not None:
991993
if agentpool.security_profile is None:
992994
agentpool.security_profile = self.models.AgentPoolSecurityProfile() # pylint: disable=no-member
993995
agentpool.security_profile.ssh_access = ssh_access
994996
if ssh_access == CONST_SSH_ACCESS_LOCALUSER:
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-
)
997+
logger.warning(
998+
"The new node pool will enable SSH access, recommended to use "
999+
"'--ssh-access disabled' option to disable SSH access for the node pool to make it more secure."
1000+
)
10021001
return agentpool
10031002

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

0 commit comments

Comments
 (0)