Skip to content

Check/count volumes (or even environment variables) that they don't exist #167

@dj-wasabi

Description

@dj-wasabi

Hi,

I have a helm template that based on a bool, a specific volume is added or not. I try to test this with a unit test but I don't get it to work.

I have tried this (only 1 volume instead of 2)

  - isNotEmpty:
      path: spec.template.spec.volumes[0]
  - isEmpty:
      path: spec.template.spec.volumes[1]

I also used contain, but then it complains about that I am comparing yaml which isn't supported. Based (on actually the same boolean) I add 2 environment variables. So if I set it to false, I dont want the volume and environment variables. And I want to test this.

So I am not sure how to continue with this. Any suggestions on how to resolve it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions