Closed Radolumbo closed 3 years ago
Can I please request...
localStorage
, found in Javascript console. Looks like:Storageย {managedNamespace: "argo", loglevel:webpack-dev-server: "INFO", ListOptions/options: "{"selectedPhases":[],"selectedLabels":[],"paginationLimit":500}", current_namespace: "", length: 4}
E.G.
Storage {managedNamespace: "s-workflow-platform", ListOptions/options: "{"selectedPhases":[],"selectedLabels":[],"paginationLimit":500}", current_namespace: "", length: 3}
ListOptions/options: "{"selectedPhases":[],"selectedLabels":[],"paginationLimit":500}"
current_namespace: ""
length: 3
managedNamespace: "s-workflow-platform"
__proto__: Storage
When I browse to the base URL (aka just /), it auto redirects me to /workflows/s-workflow-platform
But I can manually delete the namespace name in the URL (thus browsing to /workflows), whereupon it will serve (or attempt to, if I'm not permissioned) all workflows in the cluster. My expectation would be that there is no way to view cluster-wide workflows from a namespaced server, which is how it behaved in V2.
I see the same error.
This needs to be fixed here:
Basically we need to check to see if managed namespace is set.
Would anyone like to submit a PR?
Are you suggesting that we just filter down to the managed namespace on all fetchWorkflow calls?
To go in hand with this, we should probably also change the redirect from base URL to just go to /workflows/ when there is a managed namespace, too, right? That would https://github.com/argoproj/argo-workflows/blob/master/ui/src/app/app-router.tsx#L167 here, I guess?
Either that - or there's a bug in app-router?
I just edited my like 30 before your post so not sure if you saw it -- but I linked where I think this might be happening https://github.com/argoproj/argo-workflows/blob/master/ui/src/app/app-router.tsx#L167 .. if any namespace is set, which will always be true I think since we have a managed namespace in this case .. it directs there.
That said, after playing with the code a bit, I think there's more to this. This is my first time really digging into this code, so might take me a bit to fully understand, but just changing the app-router redirect definitely has some other behavior (trying to redirect just to / takes me to the login page for some reason). And just changing the filter that you originally linked to will still give an attempt to access the cluster (so it will fail on permissions if you don't have them).
Anyway, I'm still just messing with it and learning the codebase, I'll try to come up with something, but I would not discourage others from attempting a PR if they want.
I wonder if the order of those elements is important and the redirect should be top of the list?
Bump! @Radolumbo are you still investigating?
I definitely still intend on coming back to this! I've been on vacation for the last week so haven't had a chance. If someone else feels like they want to make the fix they can, else I'll be working on it next week!
Related:
fix(ui): Fix editor. Fixes #5613 Fixes #5617 (#5620)
I think this may have been fixed on master.
I'll test it out in a bit, and see!
I'm still seeing the same behavior.
I could not reproduce this. Can anyone volunteer to debug via Zoom?
I could do so. I just got back to looking at this, and I think I understand what's happening, though I haven't decided exactly the best way to approach it, yet.
I should at least have a draft PR soon for one way we can approach this. I think it's a little hacky, but it's similar to what was being done in V2, and should at least start a discussion.
Summary
What happened/what you expected to happen? In Argo v2, in namespaced server mode, going to /workflows in the Argo UI served only the workflows for the corresponding namespace of the server you're connected to. In v3, it appears to serve the workflows across the cluster, even though you're connecting to the server of a specific namespace. This forces you to go to /workflows/namespace to view your workflows if you are not permissioned to view workflows in the cluster. Before, it wasn't even possible to view cluster-wide workflows in namespaced mode, which I think is the more expected behavior.
Is this behavior intentional? Did something change about how routes are served?
Diagnostics
What version of Argo Workflows are you running? v3.0.0
Message from the maintainers:
Impacted by this bug? Give it a ๐. We prioritise the issues with the most ๐.