kubernetes-backend: fix reading credentials from undefined
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-kubernetes-backend': patch
|
||||
---
|
||||
|
||||
Fixed a crash reading `credentials` from `undefined`.
|
||||
@@ -52,7 +52,7 @@ export class CatalogClusterLocator implements KubernetesClustersSupplier {
|
||||
return new CatalogClusterLocator(catalogApi, auth);
|
||||
}
|
||||
|
||||
async getClusters(options: {
|
||||
async getClusters(options?: {
|
||||
credentials: BackstageCredentials;
|
||||
}): Promise<ClusterDetails[]> {
|
||||
const apiServerKey = `metadata.annotations.${ANNOTATION_KUBERNETES_API_SERVER}`;
|
||||
@@ -71,7 +71,7 @@ export class CatalogClusterLocator implements KubernetesClustersSupplier {
|
||||
{
|
||||
filter: [filter],
|
||||
},
|
||||
options.credentials
|
||||
options?.credentials
|
||||
? {
|
||||
token: (
|
||||
await this.auth.getPluginRequestToken({
|
||||
|
||||
Reference in New Issue
Block a user