Fix PostgreSQL and Redis resource lookup after chart upgrade
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:
- 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. - 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. - Makes sure that Operator does not override the PodTemplate labels that clashes with selector.
- Changes
ObjectByKindAndComponent
so that it uses bothapp
andgitlab.io/component
to find component resources. - 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
chartsgitlab.io/component
and component name and for6.x
chartsapp
and component name override is used. - 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
, duration10s
, URIscheme://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