Skip to content

Conversation

@dprotaso
Copy link

@dprotaso dprotaso commented Oct 1, 2025

This moves the rebase of argoproj/gitops-engine#771 into this repository

Part of #4764 #11972

@dprotaso dprotaso requested a review from a team as a code owner October 1, 2025 22:30
@bunnyshell
Copy link

bunnyshell bot commented Oct 1, 2025

❌ Preview Environment undeployed from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

@dprotaso dprotaso changed the title Only sync controller owner references if an annotation is present [feat] Only sync controller owner references if an annotation is present Oct 1, 2025
@dprotaso dprotaso changed the title [feat] Only sync controller owner references if an annotation is present feat: Only sync controller owner references if an annotation is present Oct 1, 2025
@codecov
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@b8e8c1f). Learn more about missing BASE report.
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
gitops-engine/pkg/cache/references.go 0.00% 6 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@pjiang-dev pjiang-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a unit test for the new sync option with resources with controller references on/off

Also this needs documentation for how to use the new sync option and why
Thanks

Comment on lines +28 to +37
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
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any UT we can add / modify to cover this extra if block?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was someone else's PR that I ported over now 2x. Can you reference an existing test I can look at?

@dprotaso
Copy link
Author

dprotaso commented Oct 2, 2025

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

@dprotaso
Copy link
Author

dprotaso commented Oct 2, 2025

/hold

See: #11972 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants