chainsaw icon indicating copy to clipboard operation
chainsaw copied to clipboard

[Feature] possibility to check log contents

Open camaeel opened this issue 5 months ago • 0 comments

Problem Statement

I would like to have a step to check pod log contents in automated and convenient way.

Solution Description

It would be great if podLogs could be used in try blocks, and checked for contents (just as command/script).

Alternatives

Workaround is to wait for workload to complete and check pod logs:

        - description: Check if pod logs contain information that the file was created.
          script:
            env:
              - name: namespace
                value: ($namespace)
            content:
              kubectl logs -n $namespace -l app=test-ebs-velero
            check:
              (contains($stdout, 'File /data/test.txt not exists. Creating')): true

Additional Context

No response

Slack discussion

No response

Research

  • [X] I have searched other issues in this repository and mine is not recorded.

camaeel avatar Aug 28 '24 07:08 camaeel