diff --git a/backstage/app-config.yaml b/backstage/app-config.yaml index ed6421d7..9cdee37a 100644 --- a/backstage/app-config.yaml +++ b/backstage/app-config.yaml @@ -47,8 +47,8 @@ catalog: providers: knativeEventMesh: dev: - token: '${KNATIVE_EVENT_MESH_TOKEN}' - baseUrl: '${KNATIVE_EVENT_MESH_BACKEND}' + token: ${KNATIVE_EVENT_MESH_TOKEN} + baseUrl: ${KNATIVE_EVENT_MESH_BACKEND} schedule: # optional; same options as in TaskScheduleDefinition # supports cron, ISO duration, "human duration" as used in code frequency: { minutes: 1 } diff --git a/backstage/plugins/knative-event-mesh-backend/README.md b/backstage/plugins/knative-event-mesh-backend/README.md index fc7295d4..bef7cfbc 100644 --- a/backstage/plugins/knative-event-mesh-backend/README.md +++ b/backstage/plugins/knative-event-mesh-backend/README.md @@ -166,7 +166,7 @@ curl -k -H "Authorization: Bearer $KUBE_SA_TOKEN" -X GET "${KUBE_API_SERVER_URL} Run a second quick check to see if the token works with the backend ```bash -KNATIVE_EVENT_MESH_BACKEND=http://localhost:8080 # or the URL of the backend +export KNATIVE_EVENT_MESH_BACKEND=http://localhost:8080 # or the URL of the backend export KUBE_SA_TOKEN=$(kubectl get secret my-eventmesh-backend-secret -o jsonpath='{.data.token}' | base64 --decode) curl -k -H "Authorization: Bearer $KUBE_SA_TOKEN" -X GET "${KNATIVE_EVENT_MESH_BACKEND}" | json_pp # Should see the response from the backend such as @@ -226,7 +226,7 @@ To install on the new backend system, add the following into the `packages/backe ```ts title=packages/backend/index.ts import { createBackend } from '@backstage/backend-defaults'; -const backend = const backend = createBackend(); +const backend = createBackend(); // Other plugins/modules diff --git a/backstage/plugins/knative-event-mesh-backend/app-config.yaml b/backstage/plugins/knative-event-mesh-backend/app-config.yaml index b2ef500d..fb5f5d11 100644 --- a/backstage/plugins/knative-event-mesh-backend/app-config.yaml +++ b/backstage/plugins/knative-event-mesh-backend/app-config.yaml @@ -2,8 +2,8 @@ catalog: providers: knativeEventMesh: dev: - token: '${KNATIVE_EVENT_MESH_TOKEN}' - baseUrl: '${KNATIVE_EVENT_MESH_BACKEND}' + token: ${KNATIVE_EVENT_MESH_TOKEN} + baseUrl: ${KNATIVE_EVENT_MESH_BACKEND} schedule: # optional; same options as in TaskScheduleDefinition # supports cron, ISO duration, "human duration" as used in code frequency: { minutes: 1 } diff --git a/backstage/plugins/knative-event-mesh-backend/src/providers/config.ts b/backstage/plugins/knative-event-mesh-backend/src/providers/config.ts index 5e5a1c5b..54776529 100644 --- a/backstage/plugins/knative-event-mesh-backend/src/providers/config.ts +++ b/backstage/plugins/knative-event-mesh-backend/src/providers/config.ts @@ -19,6 +19,7 @@ export function readKnativeEventMeshProviderConfigs(config:Config):KnativeEventM function readKnativeEventMeshProviderConfig(id:string, config:Config):KnativeEventMeshProviderConfig { const baseUrl = config.getString('baseUrl'); + const token = config.getString('token'); const schedule = config.has('schedule') ? readTaskScheduleDefinitionFromConfig(config.getConfig('schedule')) @@ -28,5 +29,6 @@ function readKnativeEventMeshProviderConfig(id:string, config:Config):KnativeEve id, baseUrl, schedule, + token, }; }