Skip to content

Fix PostgreSQL and Redis resource lookup after chart upgrade

Hossein Pursultani requested to merge hp-fix-broken-postgresql-app-label into master

What does this MR do?

After upgrading PostgreSQL and Redis charts, using the old app label selector does not locate objects hence breaking the reconcile loop.

This MR:

  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. It 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 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 component name and for 6.x charts app and component name override is used.
  6. Makes adjustments to resource names in test cases to match the upgraded Charts, given the chart version in use.

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

Related to #1211 (closed) and #1210 (closed)

Edited by Jason Plum

Merge request reports