@@ -470,10 +470,19 @@ def deploy_agent(
470470 helm_repository_name : str | None = None
471471 oci_registry : str | None = None
472472
473+ # Track OCI provider for provider-specific features
474+ oci_provider : str | None = None
475+
473476 if use_oci :
474477 oci_registry = agent_env_config .helm_oci_registry # type: ignore[union-attr]
478+ oci_provider = agent_env_config .helm_oci_provider # type: ignore[union-attr]
475479 console .print (f"[blue]ℹ[/blue] Using OCI Helm registry: { oci_registry } " )
476- login_to_gar_registry (oci_registry ) # type: ignore[arg-type]
480+
481+ # Only auto-authenticate for GAR provider
482+ if oci_provider == "gar" :
483+ login_to_gar_registry (oci_registry ) # type: ignore[arg-type]
484+ else :
485+ console .print ("[blue]ℹ[/blue] Skipping auto-authentication (no provider specified, assuming already authenticated)" )
477486 else :
478487 if agent_env_config :
479488 helm_repository_name = agent_env_config .helm_repository_name
@@ -497,6 +506,9 @@ def deploy_agent(
497506 if not use_oci :
498507 console .print ("[yellow]⚠[/yellow] --use-latest-chart only works with OCI registries, using default version" )
499508 chart_version = DEFAULT_HELM_CHART_VERSION
509+ elif oci_provider != "gar" :
510+ console .print ("[yellow]⚠[/yellow] --use-latest-chart only works with GAR provider (helm_oci_provider: gar), using default version" )
511+ chart_version = DEFAULT_HELM_CHART_VERSION
500512 else :
501513 chart_version = get_latest_gar_chart_version (oci_registry ) # type: ignore[arg-type]
502514 elif agent_env_config and agent_env_config .helm_chart_version :
0 commit comments