Merge "Fix get_secret utils func to filter for a specific namespace"

This commit is contained in:
Zuul
2020-05-11 22:34:28 +00:00
committed by Gerrit Code Review
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

@@ -200,8 +200,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
)