Skip to content

Ability to choose a shell for scripts #557

@NickLarsenNZ

Description

@NickLarsenNZ

What would you like to be added:

The ability to choose a shell for commands in TestAssert. For example:

---
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 600
commands:
  - shell: bash # runs bash -c instead of sh -c
    script: |
      set -euo pipefail
      ...
  - shell: bash -euo pipefail # runs bash -euo pipefail -c instead of sh -c
    script: |
      ...

Why is this needed:

  • Currently sh -c is hard coded for shell invocations, and without options like -e to ensure failures before the last command get picked up.
  • sh doesn't support setting -o pipefail to fail on errors in a pipeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions