Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcp cred bug fix for multiple credentials in single pipeline #1384

Merged
merged 4 commits into from
Aug 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions sdk/python/kfp/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

from kubernetes.client import V1Toleration


def use_gcp_secret(secret_name='user-gcp-sa', secret_file_path_in_volume='/user-gcp-sa.json', volume_name=None, secret_volume_mount_path='/secret/gcp-credentials'):
def use_gcp_secret(secret_name='user-gcp-sa', secret_file_path_in_volume=None, volume_name=None, secret_volume_mount_path='/secret/gcp-credentials'):
"""An operator that configures the container to use GCP service account.

The user-gcp-sa secret is created as part of the kubeflow deployment that
Expand All @@ -32,8 +31,13 @@ def use_gcp_secret(secret_name='user-gcp-sa', secret_file_path_in_volume='/user-
service account access permission.
"""

# permitted values for secret_name = ['admin-gcp-sa', 'user-gcp-sa']
if secret_file_path_in_volume is None:
secret_file_path_in_volume = '/' + secret_name + '.json'

if volume_name is None:
volume_name = 'gcp-credentials-' + secret_name

else:
import warnings
warnings.warn('The volume_name parameter is deprecated and will be removed in next release. The volume names are now generated automatically.', DeprecationWarning)
Expand Down Expand Up @@ -107,4 +111,4 @@ def _set_preemptible(task):
task.add_node_selector_constraint("cloud.google.com/gke-preemptible", "true")
return task

return _set_preemptible
return _set_preemptible