Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect controller flag in owner references #12210

Open
mkjpryor opened this issue Jan 30, 2023 · 4 comments
Open

Respect controller flag in owner references #12210

mkjpryor opened this issue Jan 30, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@mkjpryor
Copy link

mkjpryor commented Jan 30, 2023

Summary

Currently, Argo CD only considers resources with no owner references as top-level resources, and hence refuses to delete objects that have any owner references.

I would like to have a configuration and/or sync option to say that only owner references with controller: true should be respected when determining whether a resource is a top-level resource and can be deleted by Argo.

Motivation

I would like to use Argo CD to manage Cluster API clusters, but Cluster API adds owner references with controller: false to all resources that are part of a cluster but not directly managed by Cluster API (in particular, MachineDeployments). This means that Argo CD refuses to delete those resources even though it created them and there are no other controllers managing them.

I believe that that this is the correct behaviour from Cluster API, as those resources do indeed have a dependency on the Cluster object but Cluster API is not responsible for managing their lifecycle (other than cascade deletion).

Currently, this is a massive blocker for anyone who wants to use Argo CD to manage Cluster API clusters.

Proposal

I would like to see an additional sync option, RespectControllerReferencesOnly=true, that can be set on an application to enable this behaviour.

@mkjpryor mkjpryor added the enhancement New feature or request label Jan 30, 2023
@mkjpryor
Copy link
Author

I'm happy to have a go at a patch, but am struggling to find where in the code I can implement this that has access to the sync options for the app but is also able to influence the owner references.

My first thought was resolveResourceReferences (https://github.com/argoproj/gitops-engine/blob/31311943a57a45389dc01412572356f2fdbca128/pkg/cache/references.go#L21), but I am struggling to see how to pass in a sync option.

@jaideepr97
Copy link
Contributor

hi @mkjpryor, thanks for raising this
Please see #11972
this is a valid request, and was discussed in one of the contributor meetings

@abhipsnl
Copy link

abhipsnl commented Mar 3, 2024

so no one woking on this?

@mkjpryor
Copy link
Author

mkjpryor commented Mar 7, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants