Commit 481f170
Fix pod name discovery using label selector instead of construction
Pod names vary based on Galera cluster names and cannot be reliably
constructed from backup names alone. Use label selector to discover
pods dynamically.
Problem:
- Cell1 pod: openstack-cell1-restore-openstack-cell1restore
- Main pod: openstack-restore-openstackrestore
- Pattern: <galera-cluster>-restore-<galerarestore-cr>
- Galera cluster name comes from GaleraBackup spec, not backup name
Solution:
- Use label selector: -l cr=<galerarestore-cr-name>
- Galera operator labels pods with cr=<galerarestore-name>
- Discover pod dynamically instead of constructing name
- Works for all Galera cluster naming conventions
Changes:
- Wait task: Discover pod using label selector
- Automated restore: Discover pod using label selector
- Helper script: Discover pod using label selector
- Remove hardcoded pod name construction
Example:
GaleraRestore CR: openstack-cell1restore
Label selector: -l cr=openstack-cell1restore
Discovered pod: openstack-cell1-restore-openstack-cell1restore
This fixes pod discovery for all Galera cluster configurations.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 27794a5 commit 481f170
2 files changed
Lines changed: 33 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1035 | 1035 | | |
1036 | 1036 | | |
1037 | 1037 | | |
1038 | | - | |
1039 | 1038 | | |
1040 | | - | |
| 1039 | + | |
1041 | 1040 | | |
1042 | | - | |
| 1041 | + | |
1043 | 1042 | | |
1044 | | - | |
1045 | | - | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
1046 | 1049 | | |
1047 | 1050 | | |
1048 | 1051 | | |
1049 | 1052 | | |
1050 | 1053 | | |
1051 | 1054 | | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
1052 | 1060 | | |
1053 | 1061 | | |
1054 | 1062 | | |
| |||
1120 | 1128 | | |
1121 | 1129 | | |
1122 | 1130 | | |
1123 | | - | |
1124 | 1131 | | |
1125 | 1132 | | |
1126 | 1133 | | |
1127 | | - | |
1128 | 1134 | | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
1132 | 1142 | | |
1133 | 1143 | | |
1134 | 1144 | | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
1135 | 1148 | | |
1136 | 1149 | | |
1137 | 1150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | 69 | | |
72 | | - | |
73 | | - | |
| 70 | + | |
74 | 71 | | |
75 | 72 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
80 | 81 | | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
0 commit comments