Commit 7ec3ad0
authored
fix: Remove Finalizer from resource if create returns error (#185)
Issue [#2406#issuecomment-2860631351](aws-controllers-k8s/community#2406 (comment))
Description of changes:
The reason marking a resource as managed (putting the finalizer)
before attempting a create is a general practice in kubernetes. The main reason we
do it is to protect against deletion protection.
If we don't put the finalizer, there is no deletion protection against the resource.
The current adoption logic expects the resource to not be managed
(no finalizer) to trigger an adoption.
If the initial creation attempt of a resource fails due to any AWS
error, any subsequent reconciliations attempting to adopt an existing
resource will not succeed.
These changes set the resource as unmanaged if for any reason there is
an error during the create call, which will allow the adoption logic to
run in subsequent reconciliations.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.1 parent 6a1bc57 commit 7ec3ad0
2 files changed
+74
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
636 | 636 | | |
637 | 637 | | |
638 | 638 | | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
639 | 649 | | |
640 | 650 | | |
641 | 651 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
227 | 290 | | |
228 | 291 | | |
229 | 292 | | |
| |||
1249 | 1312 | | |
1250 | 1313 | | |
1251 | 1314 | | |
1252 | | - | |
| 1315 | + | |
1253 | 1316 | | |
1254 | 1317 | | |
1255 | 1318 | | |
| |||
0 commit comments