Skip to content

Commit

Permalink
add test for secret volume and mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
ekneg54 committed Jul 11, 2024
1 parent 1ef1b78 commit b009f43
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/unit/charts/test_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,17 @@ def test_artifacts_volume_not_populated_if_not_defined(self):
volumes = self.deployment["spec.template.spec.volumes"]
artifacts_volume = [volume for volume in volumes if volume["name"] == "artifacts"]
assert len(artifacts_volume) == 0

def test_extra_secrets_volumes_are_populated(self):
logprep_values = {"secrets": {"mysecret": {"name": "external-secret"}}}
self.manifests = self.render_chart("logprep", logprep_values)
volumes = self.deployment["spec.template.spec.volumes"]
volume = [volume for volume in volumes if volume["name"] == "mysecret"]
assert volume

def test_extra_secrets_are_mounted(self):
logprep_values = {"secrets": {"mysecret": {"name": "external-secret"}}}
self.manifests = self.render_chart("logprep", logprep_values)
mounts = self.deployment["spec.template.spec.containers.0.volumeMounts"]
mount = [mount for mount in mounts if mount["name"] == "mysecret"]
assert mount

0 comments on commit b009f43

Please sign in to comment.