Skip to content

Commit 889b7a8

Browse files
committed
address comments
1 parent 1cd59de commit 889b7a8

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

src/aks-agent/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Run in non-interactive batch mode
105105

106106
.. code-block:: bash
107107
108-
az aks agent "Diagnose networking issues" --no-interactive --max-steps 15 --model azure/my-gpt4.1-deployment
108+
az aks agent "Diagnose networking issues" --no-interactive --name MyManagedCluster --resource-group MyResourceGroup --model azure/my-gpt4.1-deployment
109109
110110
Clean up the AKS agent
111111
-----------------------

src/aks-agent/azext_aks_agent/_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
- name: Ask about pod issues in the cluster with last configured model
5757
text: |-
5858
az aks agent "Why are my pods not starting?" --resource-group myResourceGroup --name myAKSCluster
59-
- name: Check AKS agent deployment status
59+
- name: Check AKS agent deployment status
6060
text: |-
6161
az aks agent --status --resource-group myResourceGroup --name myAKSCluster
6262
- name: Ask about pod issues in the cluster with Azure OpenAI

src/aks-agent/azext_aks_agent/agent/aks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def get_aks_credentials(
3939
kubeconfig_path = _get_kubeconfig_file_path(resource_group_name, cluster_name)
4040

4141
# Ensure the kubeconfig file exists and write kubeconfig to it
42-
with os.fdopen(os.open(kubeconfig_path, os.O_CREAT | os.O_WRONLY, 0o600), 'wt') as f:
42+
with os.fdopen(os.open(kubeconfig_path, os.O_RDWR | os.O_CREAT | os.O_TRUNC, 0o600), 'wt') as f:
4343
f.write(kubeconfig)
4444

4545
logger.info("Kubeconfig downloaded successfully to: %s", kubeconfig_path)
@@ -64,7 +64,7 @@ def _get_kubeconfig_file_path( # pylint: disable=unused-argument
6464
if ex.errno != errno.EEXIST:
6565
raise
6666

67-
kubeconfig_filename = f"kubeconfig-{cluster_name}"
67+
kubeconfig_filename = f"kubeconfig-{resource_group_name}-{cluster_name}"
6868
kubeconfig_path = os.path.join(kubeconfig_dir, kubeconfig_filename)
6969

7070
return kubeconfig_path

src/aks-agent/azext_aks_agent/custom.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def aks_agent_init(cmd,
174174

175175
except Exception as e:
176176
console.print(f"❌ Error during initialization: {str(e)}", style=ERROR_COLOR)
177-
logger.error("Agent initialization failed: %s", e)
177+
raise AzCLIError("Agent initialization failed")
178178

179179

180180
def _get_existing_cluster_role(aks_agent_manager):
@@ -431,10 +431,9 @@ def aks_agent_cleanup(
431431
console.print(
432432
"❌ Cleanup failed. Please run 'az aks agent --status' to verify cleanup completion.", style=ERROR_COLOR)
433433

434+
434435
# pylint: disable=unused-argument
435436
# pylint: disable=too-many-locals
436-
437-
438437
def aks_agent(
439438
cmd,
440439
client,

0 commit comments

Comments
 (0)