Merge pull request #5053 from shoebsd31/master

#5051 entity name updated
This commit is contained in:
Ben Lambert
2021-03-30 13:54:50 +02:00
committed by GitHub
2 changed files with 9 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-kubernetes-backend': patch
---
updated entity name to be set through annotations or fallback
@@ -58,7 +58,10 @@ export class KubernetesFanOutHandler {
requestBody: KubernetesRequestBody,
objectTypesToFetch: Set<KubernetesObjectTypes> = DEFAULT_OBJECTS,
) {
const entityName = requestBody.entity.metadata.name;
const entityName =
requestBody.entity?.metadata?.annotations?.[
'backstage.io/kubernetes-id'
] || requestBody.entity?.metadata?.name;
const clusterDetails: ClusterDetails[] = await this.serviceLocator.getClustersByServiceId(
entityName,