diff --git a/main.go b/main.go index d75dffa..72e3775 100644 --- a/main.go +++ b/main.go @@ -90,6 +90,8 @@ func main() { ruleExpr := strings.TrimSuffix(rule.Expr.Value, "\n") if strings.Contains(ruleExpr, "\n") { resource += fmt.Sprintf("expr = < 0 { resource += fmt.Sprintf("annotations = {\n") for aname, avalue := range rule.Annotations { - resource += fmt.Sprintf("%s = \"%s\"\n", aname, avalue) + resource += fmt.Sprintf("%s = \"%s\"\n", aname, strings.ReplaceAll(avalue, "\"", "\\\"")) } resource += fmt.Sprintf("}\n") } @@ -142,6 +144,8 @@ func main() { ruleExpr := strings.TrimSuffix(rule.Expr.Value, "\n") if strings.Contains(ruleExpr, "\n") { resource += fmt.Sprintf("expr = <