Skip to content

Commit

Permalink
Merge pull request #5053 from shoebsd31/master
Browse files Browse the repository at this point in the history
#5051 entity name updated
  • Loading branch information
benjdlambert committed Mar 30, 2021
2 parents 1ba5d52 + 9b813eb commit bd90c8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-meals-tie.md
@@ -0,0 +1,5 @@
---
'@backstage/plugin-kubernetes-backend': patch
---

updated entity name to be set through annotations or fallback
Expand Up @@ -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,
Expand Down

0 comments on commit bd90c8f

Please sign in to comment.