fix(frontend): fixed incorrect encoding of labels in service forms

pull/81/head
Samuel Rowe 3 years ago
parent 0ac83d064f
commit 666dce3ea0

@ -136,13 +136,10 @@ export const getInitialValues = (node?: IServiceNodeItem): IEditServiceForm => {
return { hostPort, containerPort, protocol } as any; return { hostPort, containerPort, protocol } as any;
}), }),
labels: labels0.map((label) => { labels: Object.entries(labels as any).map(([key, value]: any) => ({
const [key, value] = label.split("=");
return {
key, key,
value value
}; }))
})
}; };
}; };
@ -184,8 +181,8 @@ export const getFinalValues = (
(port.containerPort ? `:${port.containerPort}` : "") + (port.containerPort ? `:${port.containerPort}` : "") +
(port.protocol ? `/${port.protocol}` : "") (port.protocol ? `/${port.protocol}` : "")
), ),
labels: labels.map( labels: Object.fromEntries(
(label) => `${label.key}${label.value ? `=${label.value}` : ""}` labels.map((label) => [label.key, label.value])
) )
} }
} as any; } as any;

Loading…
Cancel
Save