Skip to content

Commit

Permalink
Revert "handle object or KeyValue[] labels/annnotations"
Browse files Browse the repository at this point in the history
This reverts commit 4b904ea.
  • Loading branch information
andrewazores committed Feb 29, 2024
1 parent 20f3e46 commit d748cee
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/app/Topology/Entity/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit d748cee

Please sign in to comment.