Skip to content

Commit

Permalink
feat(cli): expose existing_token client property (#11400)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Coufal <[email protected]>
  • Loading branch information
tumido authored Nov 25, 2024
1 parent 2e05b3d commit 35793be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions sdk/RELEASE.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
10 changes: 7 additions & 3 deletions sdk/python/kfp/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))),
Expand All @@ -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))
Expand All @@ -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

0 comments on commit 35793be

Please sign in to comment.