Skip to content

Commit

Permalink
tekton: allow skipped tasks
Browse files Browse the repository at this point in the history
Intentionally skipped tasks shouldn't be considered as unsuccesfull in
OSBS context. Allow skipped tasks in OSBS.

Signed-off-by: Martin Basti <[email protected]>
  • Loading branch information
MartinBasti committed Nov 20, 2024
1 parent c58a280 commit 32bb084
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions osbs/tekton.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,8 @@ def get_error_message(self):

task_name = task_info['metadata']['labels']['tekton.dev/pipelineTask']
got_task_error = False
if task_info['status']['conditions'][0]['reason'] == 'Succeeded':
if task_info['status']['conditions'][0]['reason'] in ['Succeeded', 'None']:
# tekton: "None" reason means skipped task; yes string
continue

if 'steps' in task_info['status']:
Expand Down Expand Up @@ -581,7 +582,8 @@ def get_final_platforms(self):
def has_succeeded(self):
status_reason = self.status_reason
logger.info("Pipeline run info: '%s'", self.data)
return status_reason == 'Succeeded'
# tekton: completed means succeeded with a skipped task
return status_reason in ['Succeeded', 'Completed']

def has_not_finished(self):
data = self.data
Expand Down

0 comments on commit 32bb084

Please sign in to comment.