Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The task result before retry is retained in the current taskrun status. #7125

Closed
cugykw opened this issue Sep 18, 2023 · 1 comment · Fixed by #7126
Closed

The task result before retry is retained in the current taskrun status. #7125

cugykw opened this issue Sep 18, 2023 · 1 comment · Fixed by #7126
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@cugykw
Copy link
Contributor

cugykw commented Sep 18, 2023

The task result before retry is retained in the current taskrun status.

There is a code scanning task in my pipeline, which returns failure or success based on the result. When it fails, a link will be generated and written to the task result. The final task will send me a message based on this result. I set a retry count for this task.

The first execution failed (because the external scanning service queue was full), and the task succeeded when it was retried and executed again, but the message was still sent to me.

Expected Behavior

This taskrun should clean up the last results when retrying, and the final task does not need to send me a message in the end.

Actual Behavior

The final task send me a message in the end.

Steps to Reproduce the Problem

kind: PipelineRun
metadata:
  name: demo
spec:
  pipelineSpec:
    finally:
     - name: send-all-report
       params:
       - name: scan-result
         value: $(tasks.scan.results.scan-failed-report)
       taskSpec:
         steps:
         - image: example.com/notify/demo:latest
           name: send-scan-report
           script: |
             # some commands
    tasks:
     - name: scan
       retries: 2
       taskSpec:
         results:
         - name: scan-failed-report
           type: string
         steps:
         - image: example.com/scan/demo:latest
           name: demo
           script: |
             # For example:
             # The first execution fails and then the successful execution of the command
...

/kind bug

@cugykw cugykw added the kind/bug Categorizes issue or PR as related to a bug. label Sep 18, 2023
@cugykw
Copy link
Contributor Author

cugykw commented Sep 18, 2023

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant