Skip to content

Commit a541073

Browse files
fixing name display
1 parent 810be1e commit a541073

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/lib/api/types/crossplane/CRDList.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ export type CRDResponse = {
66
metadata: {
77
name: string;
88
creationTimestamp: string;
9+
ownerReferences: [
10+
{
11+
kind: string;
12+
name: string;
13+
},
14+
];
915
};
1016
status: {
1117
conditions: [

src/lib/api/useApiResource.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,12 @@ export const useProvidersConfigResource = (config?: SWRConfiguration) => {
7070

7171
const providerConfigsData: ProviderConfigsData[] =
7272
crdWithProviderConfig?.map((item) => {
73+
const providerName = item.metadata.ownerReferences.find(
74+
(x) => x.kind === 'Provider',
75+
)?.name;
76+
7377
return {
74-
provider: item.metadata.name,
78+
provider: providerName ? providerName : '',
7579
name: item.spec.group,
7680
versions: item.spec.versions,
7781
};

0 commit comments

Comments
 (0)