Skip to content

Commit

Permalink
fix(sdk): Respect namespace if set on client (#7056)
Browse files Browse the repository at this point in the history
* respect namespace if set on client

* make sure is_multi_user

* overwrite directly context_setting

* revert non-related changes

* revert overwrite_namespace

* expand text

* add release notes

* add PR link
  • Loading branch information
casassg authored Jan 11, 2022
1 parent 9ba1a4f commit fc2d05f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions sdk/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Add ImporterSpec v2 [\#6917](https://github.com/kubeflow/pipelines/pull/6917)
* Add add set_env_variable for Pipeline task [\#6919](https://github.com/kubeflow/pipelines/pull/6919)
* Add metadata field for importer [\#7112](https://github.com/kubeflow/pipelines/pull/7112)
* kfp.Client uses namespace from initialization if set for the instance context [\#7056](https://github.com/kubeflow/pipelines/pull/7056).

## Breaking Changes

Expand Down
6 changes: 6 additions & 0 deletions sdk/python/kfp/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ def __init__(self,
# Save the loaded API client configuration, as a reference if update is
# needed.
self._load_context_setting_or_default()

# If custom namespace provided, overwrite the loaded or default one in
# context settings for current client instance
if namespace != 'kubeflow':
self._context_setting['namespace'] = namespace

self._existing_config = config
if cookies is None:
cookies = self._context_setting.get('client_authentication_cookie')
Expand Down

0 comments on commit fc2d05f

Please sign in to comment.