Commit bc72971
authored
fix: avoid ownership of fields for updates (#2087)
**Description**
PR #1930 introduced patchFinalizersWithServerSideApply which uses
client.ForceOwnership with field owner aigateway-controller. While
intended only to manage the finalizers field, the SSA call marshals the
entire object, causing the controller to claim ownership of every field
on the resource — including labels managed by Helm (helm.sh/chart,
app.kubernetes.io/managed-by, etc.).
This breaks Helm-managed deployments. When users install AI Gateway
resources (e.g. AIServiceBackend) via a Helm chart, subsequent helm
upgrade operations fail with:
```
Apply failed with 1 conflict: conflict with "aigateway-controller":
.metadata.labels.helm.sh/chart
```
This commit restores the previous behavior using client.Update() to
persist finalizers.
**Related Issues/PRs (if applicable)**
reverts #1930
**Special notes for reviewers (if applicable)**
The client.Update() is used for simplicity as I am not sure of a solid
use case for forcing ownerships on resources hence preferring
simplicity, that said if we have a use I am happy to explore options
where ownership is claimed only for finalizers and not for the entire
object.
---------
Signed-off-by: siddharth1036 <siddharthshah1036@gmail.com>1 parent d5135af commit bc72971
2 files changed
Lines changed: 16 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
46 | | - | |
47 | 44 | | |
48 | 45 | | |
49 | 46 | | |
| |||
546 | 543 | | |
547 | 544 | | |
548 | 545 | | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
| 546 | + | |
569 | 547 | | |
570 | 548 | | |
571 | | - | |
| 549 | + | |
572 | 550 | | |
573 | 551 | | |
574 | 552 | | |
| |||
583 | 561 | | |
584 | 562 | | |
585 | 563 | | |
586 | | - | |
| 564 | + | |
587 | 565 | | |
588 | 566 | | |
589 | 567 | | |
| |||
600 | 578 | | |
601 | 579 | | |
602 | 580 | | |
603 | | - | |
| 581 | + | |
604 | 582 | | |
605 | 583 | | |
606 | 584 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
520 | | - | |
| 520 | + | |
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
534 | | - | |
| 534 | + | |
535 | 535 | | |
536 | 536 | | |
537 | | - | |
| 537 | + | |
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
566 | | - | |
| 566 | + | |
567 | 567 | | |
568 | 568 | | |
569 | | - | |
| 569 | + | |
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
| |||
599 | 599 | | |
600 | 600 | | |
601 | 601 | | |
602 | | - | |
| 602 | + | |
603 | 603 | | |
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
610 | | - | |
| 610 | + | |
611 | 611 | | |
612 | 612 | | |
613 | | - | |
| 613 | + | |
614 | 614 | | |
615 | 615 | | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
620 | 620 | | |
621 | 621 | | |
622 | 622 | | |
| |||
0 commit comments