Skip to content

quoted-strings - support JSON encoded data in single quotes #668

@Constantin07

Description

@Constantin07

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/

Annotation keys and values can only be strings. Advanced format should be encoded as below:
...
json: 'jsonContent'

Linting this fails:

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: echoserver
  annotations:
   ...
    alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS": 443}]'

with error:

aws-loadbalancer-controller/test.yml
  83:53     error    string value is not quoted with double quotes  (quoted-strings)
  86:45     error    string value is not quoted with double quotes  (quoted-strings)

Would be possible to add support for this case instead of settigng quote-type: any (by default we use double)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions