The function puts too many quotes in the yaml output if such a sequence appears in a quoted json string.
I've used such a code block to reproduce the issue:
package main
import (
"fmt"
"sigs.k8s.io/yaml"
)
func main() {
j := []byte(`{"example": "OMG my ' #' is messed"}`)
y, _ := yaml.JSONToYAML(j)
fmt.Println(string(y))
}
Output:
example: 'OMG my '' #'' is messed'
Example of a correct behaviour:
j := []byte(`{"example": "OMG my 'a#' is messed"}`)
Output:
example: OMG my 'a#' is messed
Reproduces even if the quoted string contains any other chars around the ' #' sequence.
I can also see the bug in kubectl output and during helm rendering.
The function puts too many quotes in the yaml output if such a sequence appears in a quoted json string.
I've used such a code block to reproduce the issue:
Output:
example: 'OMG my '' #'' is messed'Example of a correct behaviour:
Output:
example: OMG my 'a#' is messedReproduces even if the quoted string contains any other chars around the ' #' sequence.
I can also see the bug in kubectl output and during helm rendering.