From 35793be4168584b1084169b723bfb216aa4a03b6 Mon Sep 17 00:00:00 2001 From: Tom Coufal <7453394+tumido@users.noreply.github.com> Date: Mon, 25 Nov 2024 22:24:51 +0100 Subject: [PATCH] feat(cli): expose existing_token client property (#11400) Signed-off-by: Tomas Coufal --- sdk/RELEASE.md | 1 + sdk/python/kfp/cli/cli.py | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sdk/RELEASE.md b/sdk/RELEASE.md index 171d83548eb..7c3813e7359 100644 --- a/sdk/RELEASE.md +++ b/sdk/RELEASE.md @@ -1,6 +1,7 @@ # Current Version (in development) ## Features +* Expose `--existing-token` flag in `kfp` CLI to allow users to provide an existing token for authentication. [\#11400](https://github.com/kubeflow/pipelines/pull/11400) ## Breaking changes diff --git a/sdk/python/kfp/cli/cli.py b/sdk/python/kfp/cli/cli.py index a4711ca34b7..dc16f40361f 100644 --- a/sdk/python/kfp/cli/cli.py +++ b/sdk/python/kfp/cli/cli.py @@ -85,6 +85,9 @@ def _install_completion(shell: str) -> None: @click.option( '--other-client-secret', help=parsing.get_param_descr(client.Client, 'other_client_secret')) +@click.option( + '--existing-token', + help=parsing.get_param_descr(client.Client, 'existing_token')) @click.option( '--output', type=click.Choice(list(map(lambda x: x.name, OutputFormat))), @@ -94,8 +97,8 @@ def _install_completion(shell: str) -> None: @click.pass_context @click.version_option(version=kfp.__version__, message='%(prog)s %(version)s') def cli(ctx: click.Context, endpoint: str, iap_client_id: str, namespace: str, - other_client_id: str, other_client_secret: str, output: OutputFormat, - show_completion: str, install_completion: str): + other_client_id: str, other_client_secret: str, existing_token: str, + output: OutputFormat, show_completion: str, install_completion: str): """Kubeflow Pipelines CLI.""" if show_completion: click.echo(_create_completion(show_completion)) @@ -113,6 +116,7 @@ def cli(ctx: click.Context, endpoint: str, iap_client_id: str, namespace: str, # Do not create a client for these subcommands return ctx.obj['client'] = client.Client(endpoint, iap_client_id, namespace, - other_client_id, other_client_secret) + other_client_id, other_client_secret, + existing_token) ctx.obj['namespace'] = namespace ctx.obj['output'] = output