Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
ab1c94e
Restore the behaviour of `--upload-fragment` for acifragmentgen (#13)
DomAyre Dec 16, 2025
35e560c
Add containers from_image command
DomAyre Nov 17, 2025
778f341
Satisfy azdev style
DomAyre Nov 18, 2025
7a351b2
Add tests
DomAyre Nov 26, 2025
cd15bf6
Split command lib versions of command
DomAyre Nov 27, 2025
3878dc0
Rename the containers lib code file
DomAyre Dec 8, 2025
5ed2d6d
Build images with buildkit for deterministic hashes
DomAyre Dec 8, 2025
e19667b
Revert "Build images with buildkit for deterministic hashes"
DomAyre Dec 8, 2025
07bc86c
Change the working_dir sample for extra_layers
DomAyre Dec 8, 2025
40dd106
.
DomAyre Dec 8, 2025
02de77b
Remove extra layers test
DomAyre Dec 8, 2025
d8247b7
Merge branch '16-12-25' into containers-from-image
DomAyre Dec 16, 2025
7647188
Review tidy ups
DomAyre Dec 16, 2025
12bc7c7
.
DomAyre Dec 16, 2025
51db435
Restore the behaviour of `--upload-fragment` for acifragmentgen (#9477)
DomAyre Dec 16, 2025
8546687
[Release] Update index.json for extension [ confcom ]
azclibot Dec 16, 2025
3d92a8a
fix: revert confcom 1.5.0 (#9483)
necusjz Dec 17, 2025
733c84b
fix: remove index (#9484)
necusjz Dec 17, 2025
f842b7c
Confcom Release 1.5.0 (#9485)
DomAyre Dec 17, 2025
2fbd824
[Release] Update index.json for extension [ confcom ]
azclibot Dec 17, 2025
13d5f49
Added CLI 1.7.0 for arcappliance (#9486)
saisankargochhayat Dec 18, 2025
2590228
Making admin commands work for serial console when the VM has a custo…
Talos10 Dec 18, 2025
5c3a479
[Release] Update index.json for extension [ serial-console-1.0.0b3 ]
azclibot Dec 18, 2025
246bd0c
[AKS] `az aks nodepool update`: Add GPU driver install options `insta…
lilypan26 Dec 19, 2025
c337353
[Release] Update index.json for extension [ aks-preview-19.0.0b18 ]
azclibot Dec 19, 2025
fc543c4
{AKS}: fix BlockingIOError by setting stdout to non-blocking (#9473)
mainred Dec 19, 2025
5c28c3b
[Release] Update index.json for extension [ aks-agent-1.0.0b14 ]
azclibot Dec 19, 2025
37f839c
Application Gateway for Containers addon commands (#9387)
JackStromberg Dec 22, 2025
76b434d
Workload-Orchestration - Backfill V2 (#9475)
manaswita-chichili Dec 22, 2025
8f94ab1
[Release] Update index.json for extension [ workload-orchestration-5.…
azclibot Dec 22, 2025
f49baf0
adding stack-hci-vm 1.11.5 (#9476)
kumdeepakgit Dec 24, 2025
97b174d
[Migrate] Start migration command, preview channel versioning & new c…
mettursathish Dec 31, 2025
9719e7e
[Release] Update index.json for extension [ migrate-3.0.0b2 ]
azclibot Dec 31, 2025
ef4b266
Quantum: fix quantum jobs test (#9481)
rigidit Jan 4, 2026
f8d0352
notification-hub: tolerate missing gcmCredential in gcm update output…
a0x1ab Jan 4, 2026
db1e8ad
[Release] Update index.json for extension [ notification-hub-2.0.0b2 ]
azclibot Jan 4, 2026
d942a12
Updating Azure Databricks API Version to 2025-10-01-preview (#9489)
2003LK Jan 5, 2026
49cc84b
[Release] Update index.json for extension [ databricks-1.2.0 ]
azclibot Jan 5, 2026
3145a03
pscloud: Release stable version 1.0.0 with CLI improvements (#9488)
DhritiJindal27 Jan 6, 2026
65a33e1
[Release] Update index.json for extension [ pscloud-1.0.0 ]
azclibot Jan 6, 2026
0af5fca
Merge remote-tracking branch 'origin/main' into containers-from-image
DomAyre Jan 7, 2026
1c7cee4
Bump confcom version
DomAyre Jan 7, 2026
122a590
Release ml 2.41.0 (#9469)
PratibhaShrivastav18 Jan 8, 2026
c226f75
[Release] Update index.json for extension [ machinelearningservices-2…
azclibot Jan 8, 2026
21b7c51
Address review comments
DomAyre Jan 8, 2026
1d3f29e
Remove preview flag from pscloud extension (#9502)
DhritiJindal27 Jan 12, 2026
3fd83ba
[Release] Update index.json for extension [ pscloud-1.0.1 ]
azclibot Jan 12, 2026
ec528f2
{Image-copy} Mask the value of the `--sas-token` parameter when displ…
yanzhudd Jan 12, 2026
76c9a43
[Release] Update index.json for extension [ image-copy-1.0.4 ]
azclibot Jan 12, 2026
77c8abb
[MIGRATE] Fix edge case errors for get-discovered-server command (#9523)
saifaldin14 Jan 14, 2026
7d386bb
[Release] Update index.json for extension [ migrate-3.0.0b3 ]
azclibot Jan 14, 2026
7ccc668
Release stack-hci-vm version 1.11.9 (#9513)
neerajdixit-msft2 Jan 14, 2026
c840aab
[devcenter] Update data plane commands to 2025-08-01-preview, control…
am-lim Jan 14, 2026
bc40d23
Upgrade edge-action extension to API version 2025-12-01-preview (#9503)
tundwed Jan 14, 2026
2c1bfb5
[Release] Update index.json for extension [ devcenter-8.0.0 ]
azclibot Jan 14, 2026
a55b3a3
[Release] Update index.json for extension [ edge-action-1.0.0b3 ]
azclibot Jan 14, 2026
ba3bd17
[confcom] Bump genpolicy version (#9504)
DomAyre Jan 14, 2026
78d8dbe
[Release] Update index.json for extension [ confcom ]
azclibot Jan 14, 2026
4972a30
Fix Gateway API tests to accommodate the removal of its prerequisite …
Winbobob Jan 15, 2026
91bcb12
[Release] Update index.json for extension [ aks-preview-19.0.0b19 ]
azclibot Jan 15, 2026
a2d5f24
Merge branch 'main' into containers-from-image
DomAyre Jan 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 24 additions & 0 deletions azure-cli-extensions.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -2704,6 +2704,20 @@
<Compile Include="src\mesh\azext_mesh\_params.py" />
<Compile Include="src\mesh\azext_mesh\__init__.py" />
<Compile Include="src\mesh\setup.py" />
<Compile Include="src\migrate\azext_migrate\aaz\__init__.py" />
<Compile Include="src\migrate\azext_migrate\commands.py" />
<Compile Include="src\migrate\azext_migrate\custom.py" />
<Compile Include="src\migrate\azext_migrate\tests\latest\test_migrate_commands.py" />
<Compile Include="src\migrate\azext_migrate\tests\latest\__init__.py" />
<Compile Include="src\migrate\azext_migrate\tests\__init__.py" />
<Compile Include="src\migrate\azext_migrate\_get_discovered_server_helpers.py" />
<Compile Include="src\migrate\azext_migrate\_help.py" />
<Compile Include="src\migrate\azext_migrate\_helpers.py" />
<Compile Include="src\migrate\azext_migrate\_initialize_replication_infrastructure_helpers.py" />
<Compile Include="src\migrate\azext_migrate\_new_local_server_replication_helpers.py" />
<Compile Include="src\migrate\azext_migrate\_params.py" />
<Compile Include="src\migrate\azext_migrate\__init__.py" />
<Compile Include="src\migrate\setup.py" />
<Compile Include="src\privatedns\azext_privatedns\commands.py" />
<Compile Include="src\privatedns\azext_privatedns\custom.py" />
<Compile Include="src\privatedns\azext_privatedns\vendored_sdks\models\aaaa_record.py" />
Expand Down Expand Up @@ -4699,6 +4713,11 @@
<Content Include="src\mesh\azext_mesh\azext_metadata.json" />
<Content Include="src\mesh\HISTORY.rst" />
<Content Include="src\mesh\README.rst" />
<Content Include="src\migrate\azext_migrate\azext_metadata.json" />
<Content Include="src\migrate\HISTORY.rst" />
<Content Include="src\migrate\linter_exclusions.yml" />
<Content Include="src\migrate\README.md" />
<Content Include="src\migrate\setup.cfg" />
<Content Include="src\resource-graph\azext_resourcegraph\azext_metadata.json" />
<Content Include="src\resource-graph\HISTORY.rst" />
<Content Include="src\resource-graph\README.rst" />
Expand Down Expand Up @@ -4877,6 +4896,11 @@
<Folder Include="src\mesh\azext_mesh\servicefabricmesh\mgmt\servicefabricmesh\operations" />
<Folder Include="src\mesh\azext_mesh\tests\" />
<Folder Include="src\mesh\azext_mesh\tests\latest" />
<Folder Include="src\migrate\" />
<Folder Include="src\migrate\azext_migrate\" />
<Folder Include="src\migrate\azext_migrate\aaz\" />
<Folder Include="src\migrate\azext_migrate\tests\" />
<Folder Include="src\migrate\azext_migrate\tests\latest\" />
<Folder Include="src\privatedns\" />
<Folder Include="src\privatedns\azext_privatedns\" />
<Folder Include="src\privatedns\azext_privatedns\vendored_sdks\" />
Expand Down
15 changes: 15 additions & 0 deletions linter_exclusions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ aks create:
enable_private_cluster:
rule_exclusions:
- option_length_too_long
enable_application_load_balancer:
rule_exclusions:
- option_length_too_long
load_balancer_idle_timeout:
rule_exclusions:
- option_length_too_long
Expand Down Expand Up @@ -198,6 +201,12 @@ aks update:
cluster_service_load_balancer_health_probe_mode:
rule_exclusions:
- option_length_too_long
enable_application_load_balancer:
rule_exclusions:
- option_length_too_long
disable_application_load_balancer:
rule_exclusions:
- option_length_too_long
aks agent:
parameters:
prompt:
Expand Down Expand Up @@ -3516,3 +3525,9 @@ confcom fragment attach:
signed_fragment:
rule_exclusions:
- no_positional_parameters

confcom containers from_image:
parameters:
image:
rule_exclusions:
- no_positional_parameters
9 changes: 8 additions & 1 deletion src/aks-agent/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@ To release a new version, please select a new version number (usually plus 1 to
Pending
+++++++

1.0.0b14
* Fix: set stdout to blocking mode to avoid "BlockingIOError: [Errno 35] write could not complete without blocking"
* Fix: gracefully handle the connection reset error
* Fix: correct the prompt to user `az aks agent-init` to initialize the aks agent
* Fix: dont echo the user input for Linux users
* Close websocket and restore terminal settings after `az aks agent` ends

1.0.0b13
* fix subscription id not correclty set in helm chart
* Fix subscription id not correctly set in helm chart

1.0.0b12
++++++++
Expand Down
84 changes: 79 additions & 5 deletions src/aks-agent/azext_aks_agent/agent/aks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

import errno
import os
import subprocess

import yaml
from azure.cli.core.azclierror import AzCLIError
from knack.log import get_logger
from knack.util import CLIError

Expand All @@ -24,28 +27,99 @@
def get_aks_credentials(
client: str,
resource_group_name: str,
cluster_name: str
cluster_name: str,
admin: bool = False,
user="clusterUser",
) -> str:
"""Get AKS cluster kubeconfig."""
credentialResults = client.list_cluster_user_credentials(
resource_group_name, cluster_name
)

credentialResults = None
if admin:
credentialResults = client.list_cluster_admin_credentials(
resource_group_name, cluster_name)
else:
if user.lower() == 'clusteruser':
credentialResults = client.list_cluster_user_credentials(
resource_group_name, cluster_name)
elif user.lower() == 'clustermonitoringuser':
credentialResults = client.list_cluster_monitoring_user_credentials(
resource_group_name, cluster_name)
else:
raise AzCLIError("invalid user type for get credentials: {}".format(user))

if not credentialResults:
raise CLIError("No Kubernetes credentials found.")

kubeconfig = credentialResults.kubeconfigs[0].value.decode(
encoding='UTF-8')

kubeconfig_path = _get_kubeconfig_file_path(resource_group_name, cluster_name)

# Ensure the kubeconfig file exists and write kubeconfig to it
with os.fdopen(os.open(kubeconfig_path, os.O_RDWR | os.O_CREAT | os.O_TRUNC, 0o600), 'wt') as f:
f.write(kubeconfig)
try:
# Check if kubeconfig requires kubelogin with devicecode and convert it
if _uses_kubelogin_devicecode(kubeconfig):
import shutil
if shutil.which("kubelogin"):
try:
# Run kubelogin convert-kubeconfig -l azurecli
subprocess.run(
["kubelogin", "convert-kubeconfig", "-l", "azurecli"],
cwd=os.path.dirname(kubeconfig_path),
check=True,
)
logger.info("Converted kubeconfig to use Azure CLI authentication.")
except subprocess.CalledProcessError as e:
logger.warning("Failed to convert kubeconfig with kubelogin: %s", str(e))
except Exception as e: # pylint: disable=broad-except
logger.warning("Error running kubelogin: %s", str(e))
else:
raise AzCLIError(
"The kubeconfig uses devicecode authentication which requires kubelogin. "
"Please install kubelogin from https://github.com/Azure/kubelogin or run "
"'az aks install-cli' to install both kubectl and kubelogin. "
"If devicecode login fails, try running "
"'kubelogin convert-kubeconfig -l azurecli' to unblock yourself."
)
except (IndexError, ValueError) as exc:
raise CLIError("Fail to find kubeconfig file.") from exc

logger.info("Kubeconfig downloaded successfully to: %s", kubeconfig_path)
return kubeconfig_path


def _uses_kubelogin_devicecode(kubeconfig: str) -> bool:
try:
config = yaml.safe_load(kubeconfig)

# Check if users section exists and has at least one user
if not config or not config.get('users') or len(config['users']) == 0:
return False

first_user = config['users'][0]
user_info = first_user.get('user', {})
exec_info = user_info.get('exec', {})

# Check if command is kubelogin
command = exec_info.get('command', '')
if 'kubelogin' not in command:
return False

# Check if args contains --login and devicecode
args = exec_info.get('args', [])
# Join args into a string for easier pattern matching
args_str = ' '.join(args)
# Check for '--login devicecode' or '-l devicecode'
if '--login devicecode' in args_str or '-l devicecode' in args_str:
return True
return False
except (yaml.YAMLError, KeyError, TypeError, AttributeError) as e:
# If there's any error parsing the kubeconfig, assume it doesn't require kubelogin
logger.debug("Error parsing kubeconfig: %s", str(e))
return False


def _get_kubeconfig_file_path( # pylint: disable=unused-argument
resource_group_name: str,
cluster_name: str,
Expand Down
4 changes: 2 additions & 2 deletions src/aks-agent/azext_aks_agent/agent/k8s/aks_agent_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def exec_aks_agent(self, command_flags: str = "") -> bool:
error_msg = f"Failed to find AKS agent pods: {result}\n"
error_msg += (
"The AKS agent may not be deployed. "
"Run 'az aks agent --init' to initialize the deployment."
"Run 'az aks agent-init' to initialize the deployment."
)
raise AzCLIError(error_msg)

Expand All @@ -698,7 +698,7 @@ def exec_aks_agent(self, command_flags: str = "") -> bool:
error_msg = "No running AKS agent pods found.\n"
error_msg += (
"The AKS agent may not be deployed. "
"Run 'az aks agent --init' to initialize the deployment."
"Run 'az aks agent-init' to initialize the deployment."
)
raise AzCLIError(error_msg)

Expand Down
Loading