feat: Only sync controller owner references if an annotation is present#24814
feat: Only sync controller owner references if an annotation is present#24814dprotaso wants to merge 1 commit intoargoproj:masterfrom
Conversation
❌ Preview Environment undeployed from BunnyshellAvailable commands (reply to this comment):
|
Signed-off-by: Dave Protasowski <dprotaso@gmail.com>
3554808 to
1ca7d99
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #24814 +/- ##
=========================================
Coverage ? 60.79%
=========================================
Files ? 404
Lines ? 66224
Branches ? 0
=========================================
Hits ? 40262
Misses ? 22719
Partials ? 3243 ☔ View full report in Codecov by Sentry. |
| if resource.HasAnnotationOption(un, common.AnnotationSyncOptions, common.SyncOptionControllerReferencesOnly) { | ||
| controllerOwnerRefs := []metav1.OwnerReference{} | ||
| for _, ownerRef := range un.GetOwnerReferences() { | ||
| if ownerRef.Controller != nil && *ownerRef.Controller { | ||
| controllerOwnerRefs = append(controllerOwnerRefs, ownerRef) | ||
| } | ||
| } | ||
| ownerRefs = controllerOwnerRefs | ||
| } | ||
|
|
There was a problem hiding this comment.
Is there any UT we can add / modify to cover this extra if block?
There was a problem hiding this comment.
This was someone else's PR that I ported over now 2x. Can you reference an existing test I can look at?
|
Does it make sense to eventually have this option on by default and then the annotation lets people turn the feature off if they need it |
|
/hold See: #11972 (comment) |
|
Any update? this would be great! |
|
@afarbos can you confirm how to reproduce the issue? That was my last question here: #11972 (comment) Note - I'm looking to run the steps against a local kind cluster |
I see, I have the issue with CAPI MachinePool all the time. I would think trying the real think be hard. Couldn't you set the field manually? |
|
I created my own sample and it didn’t reproduce so I’m looking for a script
to run
…On Fri, Jan 23, 2026 at 20:06 afarbos ***@***.***> wrote:
*afarbos* left a comment (argoproj/argo-cd#24814)
<#24814 (comment)>
@afarbos <https://github.com/afarbos> can you confirm how to reproduce
the issue?
That was my last question here: #11972 (comment)
<#11972 (comment)>
Note - I'm looking to run the steps against a local kind cluster
I see, I have the issue with CAPI MachinePool all the time.
I would think trying the real think be hard. Couldn't you set the field
manually?
I would create the resource from an example (
https://cluster-api-aws.sigs.k8s.io/topics/machinepools.html#examples)
and add the ownerReferences fields. CAPI just add apiversion, kind, name
and uid. And it refer to the cluster.
—
Reply to this email directly, view it on GitHub
<#24814 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAERAUVNXGFTSFMUVGCT7D4ILARVAVCNFSM6AAAAACIBUIHHOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTOOJTGI4TKMZSG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Is there any updates on this we would love to see this changes as well. |
This moves the rebase of argoproj/gitops-engine#771 into this repository
Part of #4764 #11972