Fix get_secret utils func to filter for a specific namespace

Change-Id: I7242f0a2d617ebe38b9b46acb69726d7f708046e
This commit is contained in:
okozachenko
2020-05-12 00:09:34 +03:00
parent 4070b122b6
commit 0a3945eac2
2 changed files with 3 additions and 2 deletions

View File

@@ -34,6 +34,7 @@ class KubernetesObjectTestCase(testtools.TestCase):
SAMPLES_PATH = 'config/samples'
SAMPLE_FILE = ''
TEMPLATE_FILE = ''
@classmethod
def setUpClass(cls):
sample_path = "%s/%s" % (cls.SAMPLES_PATH, cls.SAMPLE_FILE)

View File

@@ -182,8 +182,8 @@ def get_secret(namespace, name):
"""
api = pykube.HTTPClient(pykube.KubeConfig.from_env())
secret = objects.Secret.objects(api).get(
namespace=namespace,
secret = objects.Secret.objects(api).filter(namespace=namespace).get(
name=name
)