From 88d4ac305b21232eb0b2423ced75ec440d4bf8b3 Mon Sep 17 00:00:00 2001 From: Antonio Gamez Diaz Date: Thu, 20 Oct 2022 18:59:26 +0200 Subject: [PATCH] Decode yamlseq/yamlmap to js objects Signed-off-by: Antonio Gamez Diaz --- dashboard/src/shared/yamlUtils.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dashboard/src/shared/yamlUtils.ts b/dashboard/src/shared/yamlUtils.ts index 7c4ba5a76af..8193f70a45e 100644 --- a/dashboard/src/shared/yamlUtils.ts +++ b/dashboard/src/shared/yamlUtils.ts @@ -85,7 +85,15 @@ export function getPathValueInYamlNode( path: string, ) { const splittedPath = parsePath(path); - const value = values?.getIn(splittedPath); + let value = values?.getIn(splittedPath); + + // if the value from getIn is an object, it means + // it is a YamlSeq or YamlMap, so we need to convert it + // back to a plain JS object + if (typeof value === "object") { + value = (value as any)?.toJSON(); + } + return value; }