Skip to content

Commit 8a38d1b

Browse files
committed
fix(cli): use raw cluster name for remote kubeconfig path lookup (!25)
Closes NVIDIA#28 ## Summary - `--update-kube-config` and `--get-kubeconfig` appended a `-remote` suffix to the cluster name when resolving the stored kubeconfig path, but the deploy step writes the kubeconfig under the raw name — so the suffixed path never existed, causing both flags to fail for remote clusters. - Removed the suffix logic so the lookup path matches the deploy path. The `-remote` suffix is still applied to internal kubeconfig YAML entries (cluster/context/user names) by `rewrite_kubeconfig_remote`, which is unaffected. - Inlined the `is_remote` variable since it was only used to compute the display-only `location` string.
1 parent f362963 commit 8a38d1b

1 file changed

Lines changed: 3 additions & 15 deletions

File tree

  • crates/navigator-cli/src

crates/navigator-cli/src/run.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -672,8 +672,7 @@ pub async fn cluster_admin_deploy(
672672
remote: Option<&str>,
673673
ssh_key: Option<&str>,
674674
) -> Result<()> {
675-
let is_remote = remote.is_some();
676-
let location = if is_remote { "remote" } else { "local" };
675+
let location = if remote.is_some() { "remote" } else { "local" };
677676

678677
let mut options = DeployOptions::new(name);
679678
if let Some(dest) = remote {
@@ -714,13 +713,7 @@ pub async fn cluster_admin_deploy(
714713

715714
if update_kube_config {
716715
let target_path = default_local_kubeconfig_path()?;
717-
// For remote clusters, the name includes "-remote" suffix
718-
let kubeconfig_name = if is_remote {
719-
format!("{name}-remote")
720-
} else {
721-
name.to_string()
722-
};
723-
update_local_kubeconfig(&kubeconfig_name, &target_path)?;
716+
update_local_kubeconfig(name, &target_path)?;
724717
eprintln!(
725718
"{} Updated kubeconfig at {}",
726719
"✓".green().bold(),
@@ -729,12 +722,7 @@ pub async fn cluster_admin_deploy(
729722
}
730723

731724
if get_kubeconfig {
732-
let kubeconfig_name = if is_remote {
733-
format!("{name}-remote")
734-
} else {
735-
name.to_string()
736-
};
737-
print_kubeconfig(&kubeconfig_name)?;
725+
print_kubeconfig(name)?;
738726
}
739727

740728
print_deploy_summary(name, &handle);

0 commit comments

Comments
 (0)