Enforce tests on ImagePullPolicy being always

Change-Id: I1b1c7dd5ca14588d1175a25e35c958ad0b2bfc64
This commit is contained in:
Mohammed Naser 2020-04-25 09:10:36 -04:00
parent f4103a89be
commit 555fabc0bf
1 changed files with 5 additions and 0 deletions

View File

@ -48,6 +48,11 @@ class KubernetesObjectTestCase(testtools.TestCase):
class KubernetesAppTestCaseMixin:
"""Mix-in to be used for tests that involve apps and containers."""
def test_containers_use_always_image_pull_policy(self):
"""Ensure that all containers use 'Always' as imagePullPolicy."""
for container in self.object['spec']['template']['spec']['containers']:
self.assertEqual("Always", container.get('imagePullPolicy'))
def test_containers_have_liveness_probe(self):
"""Ensure that all containers have liveness probes."""
for container in self.object['spec']['template']['spec']['containers']: