Uploaded image for project: 'OpenShift Pipelines'
  1. OpenShift Pipelines
  2. SRVKP-9425

Can no longer set maxRetention for results

XMLWordPrintable

    • 2
    • False
    • Hide

      None

      Show
      None
    • False
    • Hide
      The shipped ConfigMap includes a default defaultRetention: "30" value. When users had an existing maxRetention setting, both values are seen to be present in the ConfigMap. The configuration parsing logic checked defaultRetention first, and since it was always present (from the shipped default), it would always be used, completely ignoring the user's maxRetention setting.

      This impacted users with existing maxRetention: "40" would always get 30-day retention (from the shipped defaultRetention default) instead of their configured 40 days and the shipped defaultRetention: "30" always overrode user's maxRetention setting which resulted in premature data deletion for users with retention > 30 days. so, the deprecation was not backward compatible.
      So we have fixed the retention configuration parsing and now it checks `maxRetention` first, maintaining backward compatibility during the deprecation period.

      Show
      The shipped ConfigMap includes a default defaultRetention: "30" value. When users had an existing maxRetention setting, both values are seen to be present in the ConfigMap. The configuration parsing logic checked defaultRetention first, and since it was always present (from the shipped default), it would always be used, completely ignoring the user's maxRetention setting. This impacted users with existing maxRetention: "40" would always get 30-day retention (from the shipped defaultRetention default) instead of their configured 40 days and the shipped defaultRetention: "30" always overrode user's maxRetention setting which resulted in premature data deletion for users with retention > 30 days. so, the deprecation was not backward compatible. So we have fixed the retention configuration parsing and now it checks `maxRetention` first, maintaining backward compatibility during the deprecation period.
    • Bug Fix
    • Proposed
    • Ranked Issues

      Description of problem:

      Can no longer set maxRetention for results.  In Pipelines operator 1.20, we have deprecated the "maxRetention" and instead recommend to use "defaultRetention"

      Prerequisites (if any, like setup, operators/versions):

      Upgrade the pipelines operator to 1.20

      Steps to Reproduce

       # Try to set maxRetention via tekconconfig and notice that the controller still refers to the defaultRetention that was set by default with 1.20 operator.

       
      2025-11-01T16:00:00.003753954Z {"level":"info","ts":1762012800.0037036,"logger":"fallback","caller":"retention/job.go:47","msg":"retention job started at: 2025-11-01 16:00:00.003664189 +0000 UTC m=+88212.963357989, retention policy:

      {RunAt:*/30 * * * * DefaultRetention:720h0m0s Policies:[]}

      "}
      [anandpaladugu@localhost Downloads]$
      options:
      configMaps:
      tekton-results-config-results-retention-policy:
      data:
      defaultRetention: "720h"
      runAt: '*/30 * * * *'
       

      If you try to change the retention with "maxRetention", the it gets added below the  defaultRetention line in the configmap and the code below implies it always prioritizes defaultRetention first.
      if duration, ok := cfgMap[defaultRetention]; ok {
      v, err := ParseDuration(duration)
      if err != nil

      { return nil, fmt.Errorf("incorrect configuration for defaultRetention: %w", err) }

      rp.DefaultRetention = v
      } else if duration, ok := cfgMap[maxRetention]; ok {
      log.Println("WARNING: configuration key 'maxRetention' is deprecated; please use 'defaultRetention' instead.")
      v, err := ParseDuration(duration)
      if err != nil

      { return nil, fmt.Errorf("incorrect configuration for maxRetention: %w", err) }


      rp.DefaultRetention = v
      }
       

       

       

       

      Actual results:

      maxRetention no longer works after upgrading to operator v1.20

      Expected results:

      maxRetention should work as before. we have only deprecated it.

      Reproducibility (Always/Intermittent/Only Once):

      Always. Work around is to use defaultRetention in the tektonconfig, but customer would not know it unless they hit the issue and open a case.  The assumption (even if they read the release notes) is that deprecated features would continue to work untill removed.

       

              rh-ee-shubbhar Shubham Bhardwaj
              anand.paladugu Anand Paladugu
              Sai Raju Manthina Sai Raju Manthina
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: