kubernetes-backend: fix test data

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-09-12 10:04:02 +02:00
parent 50a530b2a8
commit 5055279d1d
2 changed files with 27 additions and 2 deletions
@@ -45,6 +45,9 @@ const entities: Entity[] = [
title: 'title',
namespace: 'default',
},
spec: {
type: 'kubernetes-cluster',
},
},
{
apiVersion: 'backstage.io/v1alpha1',
@@ -63,6 +66,9 @@ const entities: Entity[] = [
name: 'owned',
namespace: 'default',
},
spec: {
type: 'kubernetes-cluster',
},
},
];
@@ -15,7 +15,11 @@
*/
import { Config, ConfigReader } from '@backstage/config';
import { ANNOTATION_KUBERNETES_AUTH_PROVIDER } from '@backstage/plugin-kubernetes-common';
import {
ANNOTATION_KUBERNETES_API_SERVER,
ANNOTATION_KUBERNETES_API_SERVER_CA,
ANNOTATION_KUBERNETES_AUTH_PROVIDER,
} from '@backstage/plugin-kubernetes-common';
import { getCombinedClusterSupplier } from './index';
import { ClusterDetails } from '../types/types';
import { AuthenticationStrategy, DispatchStrategy } from '../auth';
@@ -146,7 +150,22 @@ describe('getCombinedClusterSupplier', () => {
const clusterSupplier = getCombinedClusterSupplier(
config,
catalogServiceMock({
entities: [{ metadata: { annotations: {}, name: 'cluster' } } as any],
entities: [
{
kind: 'Resource',
metadata: {
name: 'cluster',
annotations: {
[ANNOTATION_KUBERNETES_API_SERVER]: 'mock',
[ANNOTATION_KUBERNETES_API_SERVER_CA]: 'mock',
[ANNOTATION_KUBERNETES_AUTH_PROVIDER]: 'mock',
},
},
spec: {
type: 'kubernetes-cluster',
},
} as any,
],
}),
mockStrategy,
logger,