Commit c9d4dda
authored
Custom Labels
This update allows, users to define custom labels for any/all resources
created by the PostgreSQL Operator. Updating the PostgresCluster Spec
with custom labels in the following fields will be added to resources
when they are reconciled:
- `spec.metadata.labels` (cluster)
- `spec.archive.pgbackrest.metadata.labels` (pgbackrest)
- `spec.proxy.pgbouncer.metadata.labels` (pgbouncer)
- `spec.instances[i].metadata.labels` (instance)
The labels that get added to a resource are a combination of cluster
labels that are added globally, instance, pgbackrest, or pgbouncer
labels that are added to their corresponding resources, and the
non-user labels that the PostgreSQL Operator adds normally. When these
labels are merged non-user labels will always win, then specific
resource labels, then global labels.
End-to-end style tests have been added to ensure that when a cluster is
created and reconciled with custom labels, every resource that it creates
is labeled. The tests use resource labels to determine what resources
should be labeled. For example, PGBackRest tests list resources with the
`postgres-operator.crunchydata.com/pgbackrest` label and make sure that
it also has any label defined in `spec.archive.pgbackrest.metadata.labels`.1 parent 1294aac commit c9d4dda
File tree
20 files changed
+968
-108
lines changed- config/crd/bases
- internal
- controller/postgrescluster
- naming
- pgbackrest
- pkg/apis/postgres-operator.crunchydata.com/v1beta1
20 files changed
+968
-108
lines changedLines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
287 | 296 | | |
288 | 297 | | |
289 | 298 | | |
| |||
789 | 798 | | |
790 | 799 | | |
791 | 800 | | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
792 | 810 | | |
793 | 811 | | |
794 | 812 | | |
| |||
958 | 976 | | |
959 | 977 | | |
960 | 978 | | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
961 | 987 | | |
962 | 988 | | |
963 | 989 | | |
| |||
1986 | 2012 | | |
1987 | 2013 | | |
1988 | 2014 | | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
1989 | 2024 | | |
1990 | 2025 | | |
1991 | 2026 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | | - | |
75 | | - | |
76 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
118 | 121 | | |
119 | 122 | | |
120 | 123 | | |
| |||
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
| |||
246 | 250 | | |
247 | 251 | | |
248 | 252 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
253 | 258 | | |
254 | 259 | | |
255 | 260 | | |
| |||
0 commit comments