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;
}),
labels: labels0.map((label) => {
const [key, value] = label.split("=");
return {
labels: Object.entries(labels as any).map(([key, value]: any) => ({
key,
value
};
})
}))
};
};
@ -184,8 +181,8 @@ export const getFinalValues = (
(port.containerPort ? `:${port.containerPort}` : "") +
(port.protocol ? `/${port.protocol}` : "")
),
labels: labels.map(
(label) => `${label.key}${label.value ? `=${label.value}` : ""}`
labels: Object.fromEntries(
labels.map((label) => [label.key, label.value])
)
}
} as any;

Loading…
Cancel
Save