Commit 6b4be09
[1952] fix: round 2 of Devin review findings on platform9#1955
Two new findings from Devin's re-run on the previous fix commit:
1. Post-validation enrichment failed for clouds.yaml-backed Secrets.
GetOpenStackClients (used by fetchAndUpdateFlavors / updateOpenstackInfo)
and GetOpenstackCredentialsFromSecret (used by syncProjectName) only
read OS_* keys. For clouds.yaml-backed Secrets those keys are
missing, so after successful validation the post-validation
enrichment loop spun forever logging "OS_AUTH_URL is missing".
New helper GetOpenstackCredsInfoFromCreds(ctx, k3sclient, *OpenstackCreds)
branches on SecretContainsCloudsYAML: for clouds.yaml, parses with
Spec.CloudName and returns an OpenStackCredsInfo populated from the
parsed CloudConfig (auth_type=v3applicationcredential leaves
Username/Password/TenantName empty since App Creds carry scope at
creation time). For legacy OS_*-keyed Secrets, delegates to the
existing GetOpenstackCredentialsFromSecret path unchanged.
Four call sites switched to the new helper:
- GetOpenStackClients (credutils.go:320, region for endpoint)
- GetOpenstackInfo's security-group lookup (credutils.go:277,
TenantName for filter)
- syncProjectName (openstackcreds_controller.go:673,
TenantName -> Spec.ProjectName)
- Cinder backend pool discovery (credutils.go:2212, region)
The ValidateAndGetProviderClient legacy branch (credutils.go:374)
is unchanged — it only runs when SecretContainsCloudsYAML is false.
2. checkStatusSuccess broke during upgrade window. Previous patch
changed migrationplan_controller.go:1869 to read only Conditions;
pre-upgrade OpenstackCreds resources have the flat
OpenStackValidationStatus = Succeeded but an empty Conditions
slice until the OpenstackCreds controller re-reconciles. During
that small window MigrationPlan reconciliation blocked for those
credentials.
Added a legacy fallback: ready if either CredentialsValidated=True
(new) OR OpenStackValidationStatus == PodSucceeded (legacy). Both
paths produce the same operational signal; the OR is a transient
bridge across the upgrade window.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 185c05e commit 6b4be09
6 files changed
Lines changed: 65 additions & 8 deletions
File tree
- graphify-out/cache/ast
- k8s/migration
- internal/controller
- pkg/utils
Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1864 | 1864 | | |
1865 | 1865 | | |
1866 | 1866 | | |
1867 | | - | |
1868 | | - | |
1869 | | - | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
1870 | 1876 | | |
1871 | 1877 | | |
1872 | 1878 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
673 | | - | |
| 673 | + | |
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
120 | 168 | | |
121 | 169 | | |
122 | 170 | | |
| |||
274 | 322 | | |
275 | 323 | | |
276 | 324 | | |
277 | | - | |
| 325 | + | |
278 | 326 | | |
279 | 327 | | |
280 | 328 | | |
| |||
317 | 365 | | |
318 | 366 | | |
319 | 367 | | |
320 | | - | |
| 368 | + | |
321 | 369 | | |
322 | 370 | | |
323 | 371 | | |
| |||
2209 | 2257 | | |
2210 | 2258 | | |
2211 | 2259 | | |
2212 | | - | |
| 2260 | + | |
2213 | 2261 | | |
2214 | 2262 | | |
2215 | 2263 | | |
| |||
0 commit comments