Modify retentionPolicy using Overlays
search cancel

Modify retentionPolicy using Overlays

book

Article ID: 297916

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

Runnable  object declares the intention of having immutable objects submitted to Kubernetes based on a template (ClusterRunTemplate) whenever there's a change in any of its inputs. It allows us to provide a mutable spec that drives the creation of immutable objects whenever that spec changes.

Part of the spec is an option field called the retentionPolicy which specifies how many successful and failed runs # should be retained. Customers can change the number of runs using ytt overlays .
 
# Runs older than this (ordered by creation # time) will be deleted. Setting higher values will increase # memory footprint. 

retentionPolicy:

    # MaxFailedRuns is the number of failed runs to retain.
    maxFailedRuns: <integer>

    # MaxSuccessfulRuns is the number of successful runs to
    # retain.
    maxSuccessfulRuns: <integer>


It's important to note that in TAP v1.7 and above, the only template that stamps a Runnable is testing-pipeline. The other templates have been converted to lifecycle:tekton templates. Please see the documentation here for more details. The important thing to know is that rather than specifying the retentionPolicy inside the spec of the runnable that the template stamps out, you will instead specify the retentionPolicy in the .spec.retentionPolicy field of the template itself.





Environment

Product Version: 1.6

Resolution

Please contact Tanzu Support and provide this KB Article ID to assist with the resolution.