-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Listing ApplicationSets requires global permissions even if argocd is namespaced #15429
Comments
I'm preparing a PR with the fix, just needing to think about how to test this properly |
You can use the I don't think the right fix is to revert the list command to be namespace-scoped, as it will not let you list application sets across all namespaces. Potentially, but this would be a breaking change for the CLI UX, we could mimic behaviour of
It is important though that As mentioned, this would be a breaking change (as is your fix), so it needs some thought. |
Hi,
Yeah, I know it, but this has some problems:
I have to disagree because actually, this breaking change has already happened, in v2.7
I get your point totally, and I agree with you. Given the current ArgoCD scenario, this makes sense totally, but in that case, the RBAC has to be updated accordingly (applications are allowed by ClusterRole but applicationset aren't). If If you want, I can update my PR adding the option for As a quick fix, I have updated our cluster role to allow this permission and that's totally enough, but I'd like to solve it here instead of patching the release within our clusters. |
Yeah, that's true. Thinking, both apps-in-any-namespace and appsets-in-any-namespace are beta features, so I think it leaves us a little room for actually making some breaking changes to un-break a change introduced by that particular feature.
That'd be great! Then all that's left is to align the The ApplicationSet API in contrast uses a common Kube clientset instead. So, I'm wondering whether it would make sense to use a lister for ApplicationSet, too. It's got some performance advantages, too, to use a lister. |
I think that lister is the way to go for self managed resources when they are used intensively, but the server doesn't use them in general (maybe because there isn't any appset ui). I mean, the price of the cache could be higher than the performance improvement if the resources aren't consumed frequently. For the applicationset-controller I don't have doubts about using listers, but for the repo server I'm not totally sure, but I'm willing to add it if you think that it's the way to go. It's true that having a lister/informer the eventual appset UI will have a better performance.
I don't think so, the reason is that |
But the But thinking a little further, I think you could even check for whether apps-in-any-namespace is enabled or not in the ApplicationSet's if len(s.ApplicationNamespaces) > 0 {
listNs = q.AppSetNamespace // Now it shouldn't matter if the empty string (cluster scope) or not
} else {
listNs = s.ns
}
appIf := s.appclientset.ArgoprojV1alpha1().ApplicationSets(listNs) The above should work regardless of the mode the API server is running in, and wouldn't require the use of an informer. |
We have been talking about this by slack to speed up the process, and this is the summary (please correct me if I said somethign wrong @jannfis ):
|
…) (#15432) * fix(server): appset list uses argocd's namespace instead of all Signed-off-by: Jorge Turrado <[email protected]> * use lister to scope the observed namespaces based on which namespaces monitors for apps Signed-off-by: Jorge Turrado <[email protected]> * apply feedback Signed-off-by: Jorge Turrado <[email protected]> * add missing change 🤦 Signed-off-by: Jorge Turrado <[email protected]> * update generated manifests Signed-off-by: Jorge Turrado <[email protected]> --------- Signed-off-by: Jorge Turrado <[email protected]>
…) (#15432) * fix(server): appset list uses argocd's namespace instead of all Signed-off-by: Jorge Turrado <[email protected]> * use lister to scope the observed namespaces based on which namespaces monitors for apps Signed-off-by: Jorge Turrado <[email protected]> * apply feedback Signed-off-by: Jorge Turrado <[email protected]> * add missing change 🤦 Signed-off-by: Jorge Turrado <[email protected]> * update generated manifests Signed-off-by: Jorge Turrado <[email protected]> --------- Signed-off-by: Jorge Turrado <[email protected]>
…) (#15432) (#16203) * fix(server): appset list uses argocd's namespace instead of all * use lister to scope the observed namespaces based on which namespaces monitors for apps * apply feedback * add missing change 🤦 * update generated manifests --------- Signed-off-by: Jorge Turrado <[email protected]> Co-authored-by: Jorge Turrado Ferrero <[email protected]>
…proj#15429) (argoproj#15432) * fix(server): appset list uses argocd's namespace instead of all Signed-off-by: Jorge Turrado <[email protected]> * use lister to scope the observed namespaces based on which namespaces monitors for apps Signed-off-by: Jorge Turrado <[email protected]> * apply feedback Signed-off-by: Jorge Turrado <[email protected]> * add missing change 🤦 Signed-off-by: Jorge Turrado <[email protected]> * update generated manifests Signed-off-by: Jorge Turrado <[email protected]> --------- Signed-off-by: Jorge Turrado <[email protected]> Signed-off-by: jmilic1 <[email protected]>
…proj#15429) (argoproj#15432) * fix(server): appset list uses argocd's namespace instead of all Signed-off-by: Jorge Turrado <[email protected]> * use lister to scope the observed namespaces based on which namespaces monitors for apps Signed-off-by: Jorge Turrado <[email protected]> * apply feedback Signed-off-by: Jorge Turrado <[email protected]> * add missing change 🤦 Signed-off-by: Jorge Turrado <[email protected]> * update generated manifests Signed-off-by: Jorge Turrado <[email protected]> --------- Signed-off-by: Jorge Turrado <[email protected]>
…proj#15429) (argoproj#15432) * fix(server): appset list uses argocd's namespace instead of all Signed-off-by: Jorge Turrado <[email protected]> * use lister to scope the observed namespaces based on which namespaces monitors for apps Signed-off-by: Jorge Turrado <[email protected]> * apply feedback Signed-off-by: Jorge Turrado <[email protected]> * add missing change 🤦 Signed-off-by: Jorge Turrado <[email protected]> * update generated manifests Signed-off-by: Jorge Turrado <[email protected]> --------- Signed-off-by: Jorge Turrado <[email protected]>
…proj#15429) (argoproj#15432) * fix(server): appset list uses argocd's namespace instead of all Signed-off-by: Jorge Turrado <[email protected]> * use lister to scope the observed namespaces based on which namespaces monitors for apps Signed-off-by: Jorge Turrado <[email protected]> * apply feedback Signed-off-by: Jorge Turrado <[email protected]> * add missing change 🤦 Signed-off-by: Jorge Turrado <[email protected]> * update generated manifests Signed-off-by: Jorge Turrado <[email protected]> --------- Signed-off-by: Jorge Turrado <[email protected]> Signed-off-by: Kevin Lyda <[email protected]>
…proj#15429) (argoproj#15432) * fix(server): appset list uses argocd's namespace instead of all Signed-off-by: Jorge Turrado <[email protected]> * use lister to scope the observed namespaces based on which namespaces monitors for apps Signed-off-by: Jorge Turrado <[email protected]> * apply feedback Signed-off-by: Jorge Turrado <[email protected]> * add missing change 🤦 Signed-off-by: Jorge Turrado <[email protected]> * update generated manifests Signed-off-by: Jorge Turrado <[email protected]> --------- Signed-off-by: Jorge Turrado <[email protected]>
Checklist:
argocd version
.Describe the bug
I'm using ArgoCD v2.8.2 and when I execute
argocd appset list
I get RBAC errors because ArgoCD is trying to list the appsets in the wrong namespace:To Reproduce
Install ArgoCD with appsets enabled and ArgoCD using a single namespace, then execute
argocd appset list
Expected behavior
ApplicationSets are correctly listed without any RBAC error
The text was updated successfully, but these errors were encountered: