Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -4188,6 +4188,9 @@
- name: --admin
type: bool
short-summary: Use the cluster admin credentials to connect to the bastion.
- name: --public-fqdn
type: bool
short-summary: Get private cluster credential with server address to be public fqdn.
examples:
- name: Connect to a managed Kubernetes cluster using Azure Bastion with custom port and admin credentials.
text: az aks bastion -g MyResourceGroup --name MyManagedCluster --bastion MyBastionResource --port 50001 --admin
Expand Down
3 changes: 2 additions & 1 deletion src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -4969,7 +4969,7 @@ def aks_loadbalancer_rebalance_nodes(
return aks_loadbalancer_rebalance_internal(managed_clusters_client, parameters)


def aks_bastion(cmd, client, resource_group_name, name, bastion=None, port=None, admin=False, yes=False):
def aks_bastion(cmd, client, resource_group_name, name, bastion=None, port=None, admin=False, yes=False, public_fqdn=False):
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The public_fqdn parameter is missing its corresponding argument definition in _params.py (around line 3090-3099). Add an argument definition similar to the other boolean flags: c.argument(\"public_fqdn\", action=\"store_true\") to properly register the CLI argument.

Copilot uses AI. Check for mistakes.
import asyncio
import tempfile

Expand Down Expand Up @@ -4998,6 +4998,7 @@ def aks_bastion(cmd, client, resource_group_name, name, bastion=None, port=None,
port,
mc_id,
kubeconfig_path,
public_fqdn=public_fqdn,
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The aks_bastion_runner function does not accept a public_fqdn parameter. Its signature (line 202-204 in bastion/bastion.py) only includes: bastion_resource, port, mc_id, kubeconfig_path, test_hook. This line should be removed since the public_fqdn parameter should only be passed to aks_get_credentials (line 4993) to retrieve credentials with the correct server address.

Suggested change
public_fqdn=public_fqdn,

Copilot uses AI. Check for mistakes.
test_hook=os.getenv("AKS_BASTION_TEST_HOOK"),
)
)
Expand Down
Loading