RoadieHQ / roadie-backstage-plugins

All Backstage plugins created by Roadie.
https://roadie.io
Apache License 2.0
253 stars 370 forks source link

namespacedApps not working #1465

Closed jkleinlercher closed 1 day ago

jkleinlercher commented 4 days ago

Expected Behavior

I use the feature apps-in-any-namespace in argocd and want to display such an app which is in a specific namespace. I followed the procedure "Support for apps in any namespace beta feature" in https://www.npmjs.com/package/@roadiehq/backstage-plugin-argo-cd

Current Behavior

I enable namespacedApps with this property: https://github.com/suxess-it/sx-cnp-oss/blob/0fb9906442c3d102ba479a12d016a7dce80a9644/platform-apps/charts/backstage/values-uibklab.yaml#L106

then set argocd/app-namespace in the catalog-info.yaml: https://github.com/suxess-it/team1-demo-app1/blob/ea0232050f234d60a73cecb1532b1c225085e02b/catalog-info.yaml#L8-L9

However, the app is not fetched. Instead a http 403 is returned. This is always the case when an app which is not in argocd should get loaded:

image

and in the backstage logs I see the request but without the query parameter "?appNamespace=adn-team1" . However, I don't know if the query parameters get logged anyways.

2024-07-03T22:22:37.905Z rootHttpRouter info ::ffff:10.240.0.31 - - [03/Jul/2024:22:22:37 +0000] "GET /api/proxy/argocd/api/applications/demo-app1-prod HTTP/1.1" 403 68 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" type=incomingRequest

In argocd-server log I see that this request comes without the configure appNamespace. It requests the app in the default argocd namespace:

time="2024-07-03T22:33:44Z" level=warning msg="application does not exist" application=demo-app1-prod namespace=argocd user=backstage
time="2024-07-03T22:33:44Z" level=warning msg="finished unary call with code PermissionDenied" error="rpc error: code = PermissionDenied desc = permission denied" grpc.code=PermissionDenied grpc.method=Get grpc.service=application.ApplicationService grpc.start_time="2024-07-03T22:33:44Z" grpc.time_ms=4.392 span.kind=server system=grpc

Steps to Reproduce

as describe above

Possible Solution

Context

Your Environment

"name": "@roadiehq/backstage-plugin-argo-cd", "version": "2.6.5",

"name": "@roadiehq/backstage-plugin-argo-cd-backend", "version": "3.0.2",

jkleinlercher commented 4 days ago

We just messed up with the new argocd plugin version. As we recognized the new argocd frontend plugin uses the argocd backend plugin and not the proxy api anymore. Is that true? Do we still need the proxy configuration or is every communication working via the argocd backend plugin?

        "/argocd/api":
          target: http://sx-argocd-server.argocd:80/api/v1/
          changeOrigin: true
          secure: false
          headers:
            Cookie:
              $env: ARGOCD_AUTH_TOKEN