INNER CODE UNIT · Python
switch_namespace
IBM/AutoMLPipeline.jl · argo-workflow/agents/argo-k8s.py:119
def switch_namespace(namespace: str):
"""
Switch the active Kubernetes namespace to connect to a different namespace.
This tool changes the current Kubernetes namespace to the specified one, allowing
you to switch between different namespaces. After switching, all
subsequent kubectl commands and API calls will be directed to the new namespace.
The Kubernetes API clients are automatically reinitialized for the new namespace.
Args:
namespace (str): The name of the namespace to switch to. Must be a valid namespace
name from your cluster. Use list_namespaces() to see
available namespaces.
Returns:
dict: A dictionary containing:
- message: Success message if namespace switch was successful
- error: Error message if the namespace switch failed