From 6c022509f6540f915c3a12887fa9d486733cce9e Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Thu, 29 Feb 2024 12:05:34 -0500 Subject: [PATCH] Revert "handle object or KeyValue[] labels/annnotations" This reverts commit 4b904ea172f77cada7af6f7fb5a28b8e25fea7d0. --- src/app/Topology/Entity/utils.tsx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/app/Topology/Entity/utils.tsx b/src/app/Topology/Entity/utils.tsx index 657f459f5e..9e25102a1e 100644 --- a/src/app/Topology/Entity/utils.tsx +++ b/src/app/Topology/Entity/utils.tsx @@ -53,15 +53,8 @@ import { import { ActiveRecDetail, Nothing } from './ResourceDetails'; import { DescriptionConfig, TargetOwnedResourceType, TargetRelatedResourceType, ResourceTypes, PatchFn } from './types'; -export const keyValueEntryTransformer = (kv: { key: string; value: string }[]): string[] => { - if (Array.isArray(kv)) { - return kv.map((k) => `${k.key}=${k.value}`); - } else if (!!kv && typeof kv === 'object') { - return Object.entries(kv).map(([k, v]) => `${k}=${v}`); - } else { - throw new Error(`Unknown kv of type "${typeof kv}": ${JSON.stringify(kv)}`); - } -}; +export const keyValueEntryTransformer = (kv: { key: string; value: string }[]): string[] => + kv.map((k) => `${k.key}=${k.value}`); export const valuesEntryTransformer: (kv: string[] | object) => string[] = Object.values;