Commit 86c4446
[1953] feat: populate Expiring/Expired Conditions for Application Credentials
Wires the App Credential helpers (#1953 prior commit) through the
validation flow and controller status path:
- pkg/common/validation/openstack: extends ValidationResult with an
AppCred *utils.AppCredentialDetails field. validateFromCloudsYAML
calls utils.FetchAppCredentialDetails after successful auth when
auth_type is v3applicationcredential; populates result.AppCred when
the metadata fetch succeeds, logs a non-fatal info message and
leaves AppCred nil when the fetch is unavailable.
- internal/controller/openstackcreds_controller: setConditionsForValidResult
now takes the AppCred details and uses utils.EvaluateAppCredExpiration
to set Expiring / Expired Conditions. Mapping:
- expired -> Expired=True (Reason: Expired)
- within 7 days -> Expiring=True (Reason: Within7Days)
- within 30 days -> Expiring=True (Reason: Within30Days)
- beyond / not App Cred -> Expiring=False, Expired=False (NotApplicable / Active)
- internal/controller/openstackcreds_controller: setConditionsForInvalidResult
drops the inline heuristic switch and uses utils.MapKeystoneError on
the raw validation error. Typed gophercloud HTTP status codes win
over string matching when available.
Existing TestApplyValidationResult_ValidationFailure passes unchanged
(MapKeystoneError preserves the existing Reason output for 401 and
timeout error strings the test exercises).
Implements FR-007 / FR-008 / FR-009.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e6ebd43 commit 86c4446
10 files changed
Lines changed: 3597 additions & 3381 deletions
File tree
- graphify-out
- cache/ast
- k8s/migration/internal/controller
- pkg/common/validation/openstack
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| 92 | + | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| 100 | + | |
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
| |||
115 | 118 | | |
116 | 119 | | |
117 | 120 | | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
125 | | - | |
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
| |||
198 | 201 | | |
199 | 202 | | |
200 | 203 | | |
| 204 | + | |
201 | 205 | | |
202 | 206 | | |
203 | 207 | | |
| 208 | + | |
204 | 209 | | |
205 | 210 | | |
| 211 | + | |
206 | 212 | | |
207 | 213 | | |
| 214 | + | |
| 215 | + | |
208 | 216 | | |
209 | 217 | | |
210 | 218 | | |
| |||
213 | 221 | | |
214 | 222 | | |
215 | 223 | | |
216 | | - | |
217 | | - | |
218 | | - | |
| 224 | + | |
219 | 225 | | |
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: 1 addition & 0 deletions
Large diffs are not rendered by default.
Large diffs are not rendered by default.
0 commit comments