Skip to content

Looking for a way to escape period for yaml params that have dots in them #2247

Open
@hferguson

Description

Please describe your feature request.
A clear and concise description of what the request is and what it would solve.
I would like to use yq to inject a parameter with dots and slashes in it. For example, I would like to represent the following which is an ingress annotation for helm:

globals: ingressAnnotations: cert-manager.io/cluster-issuer: letsencrypt

I tried appending this to my yaml file by using
yq -i '.globals.ingressAnnotations.certmanager.io/cluster-issuer="letsencrypt"' values.yaml
and this resulted in
globals: ingressAnnotations: cert-manager: io/cert-manager: letsencrypt
Maybe this exists already, but is there a way to escape dots so they aren't treated as delimiters? I already tried escaping the dot with a slash i.e. "cert-manager.io" but that only gave me the slash

The use case why I would do this has to do with OpenText Corporation's helm chart for Content Server deployments where you get the chart with a default values.yaml and you add/update by passing parameters to your helm install call

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions