Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Updated manager.py for reading secrets to check for the existence of … #495

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion kubeflow/fairing/kubernetes/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def secret_exists(self, name, namespace):
:returns: bool: True if the secret exists, otherwise return False.

"""
secrets = client.CoreV1Api().list_namespaced_secret(namespace)
secrets = client.CoreV1Api().read_namespaced_secret(namespace)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The read_namespaced_secret function should be like this read_namespaced_secret(name, namespace, pretty=pretty, exact=exact, export=export) from docs https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/CoreV1Api.md#read_namespaced_secret. The name should be required args.

secret_names = [secret.metadata.name for secret in secrets.items]
return name in secret_names

Expand Down