Open Constantin07 opened 7 months ago
What would the logic for this have to look like to be reliable? Suppose quote-type
is double
, would you expect that a string that contains one or more literal "
characters should be exempt from the rule? Would some users not like this, because you can still escape "
if you really want to keep strict double quoting?
alb.ingress.kubernetes.io/actions.ssl-redirect: "{\"Type\": \"redirect\", \"RedirectConfig\": { \"Protocol\": \"HTTPS\", \"Port\": \"443\", \"StatusCode\": \"HTTP_301\"}}"
Another workaround is to make it a multiline scalar.
alb.ingress.kubernetes.io/actions.ssl-redirect: >-
{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}
I would personally style it with the JSON pretty-printed.
alb.ingress.kubernetes.io/actions.ssl-redirect: >-
{
"Type": "redirect",
"RedirectConfig": {
"Protocol": "HTTPS",
"Port": "443",
"StatusCode": "HTTP_301"
}
}
Thanks @andrewimeson, I think your suggestion with JSON pretty-printed works just fine.
For some Kubernetes manifests there are annotation with values in JSON format which have to be quoted in single quotes.
One example is AWS Load balancer Controller: https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.2/guide/ingress/annotations/
Linting this fails:
with error:
Would be possible to add support for this case instead of settigng
quote-type: any
(by default we usedouble
)?