Skip to content

[Backport] Fix PostgreSQL and Redis resource lookup after chart upgrade

Hossein Pursultani requested to merge hp-backport-fixes-to-0-20-stable into 0-20-stable

What does this MR do?

This MR backports !619 (merged), which contains a critical fix, to 0-20-stable branch. It is required for Operator 0.20 release.

It also includes !623 (merged) which is a minor change that ensure the pipeline will not fail on long branch name (such as the branch name of this MR).

Summary of !619 (merged):

Fix PostgreSQL and Redis resource lookup after chart upgrade

The following changes are included:

  1. Removes the common labels, i.e. app.kubernetes.io/*, that are added by Operator to PostgreSQL and Redis charts. These labels clash with the upgraded PostgreSQL and Redis charts. It turns out that the older version of PostgreSQL and Redis Charts were ignoring these values.
  2. Introduces gitlab.io/component label to PostgreSQL and Redis charts and uses it as an indicator to select the resources associated to these components. This is used for newer versions of PostgreSQL and Redis charts.
  3. Makes sure that Operator does not override the PodTemplate labels that clashes with selector.
  4. Changes ObjectByKindAndComponent so that it uses both labels, i.e. app and gitlab.io/component, to find component resources.
  5. Adds a provision in PostgreSQL and Redis resource lookups so that based on GitLab Chart version it chooses the right label and value to locate resources. For 7.x charts gitlab.io/component and name of the component are used and for 6.x charts app and component name override are used.
  6. Makes adjustments to resource names in test cases to match the upgraded Charts, given the chart version in use.

Changelog: fixed

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion.

Required

  • Merge Request Title and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA
  • Equivalent MR/issue for omnibus-gitlab opened
  • Validate potential values for new configuration settings. Formats such as integer 10, duration 10s, URI scheme://user:passwd@host:port may require quotation or other special handling when rendered in a template and written to a configuration file.

Related issues

This MR is required to fix all pipeline failure issues on 0-20-stable branch.

Edited by Mitchell Nielsen

Merge request reports