Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yq write wraps long lines #452

Closed
yene opened this issue Jun 3, 2020 · 3 comments
Closed

yq write wraps long lines #452

yene opened this issue Jun 3, 2020 · 3 comments
Labels

Comments

@yene
Copy link

yene commented Jun 3, 2020

Describe the bug
yq w -i test.yaml "spec.template.spec.containers[0].image" jupyter/datascience-notebook:1 wraps long line. I expected that it does not touch anything aside from the given path.

Thank you for taking the time to look at my report.

Input Yaml

test.yml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: jupyter
spec:
  selector:
    matchLabels:
      app: jupyter
  template:
    metadata:
      labels:
        app: jupyter
        image: juypter
    spec:
      securityContext:
        fsGroup: 50000
      containers:
      - name: airflow
        image: jupyter/datascience-notebook
        args: ["start-notebook.sh", "--ip=0.0.0.0", "--NotebookApp.token=''", "--NotebookApp.password=''", "--NotebookApp.base_url='/jupyter/'"]

out.yml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: jupyter
spec:
  selector:
    matchLabels:
      app: jupyter
  template:
    metadata:
      labels:
        app: jupyter
        image: juypter
    spec:
      securityContext:
        fsGroup: 50000
      containers:
      - name: airflow
        image: jupyter/datascience-notebook:1
        args: ["start-notebook.sh", "--ip=0.0.0.0", "--NotebookApp.token=''", "--NotebookApp.password=''",
          "--NotebookApp.base_url='/jupyter/'"]

Command
The command you ran:

yq w -i test.yaml "spec.template.spec.containers[0].image" jupyter/datascience-notebook:1
@yene yene added the bug label Jun 3, 2020
@mikefarah
Copy link
Owner

This is an issue with the underlying go-yaml library, it automatically line wraps and does not provide an option to turn it off (go-yaml/yaml#387)

@kungfoome
Copy link

looks like this is fixed in 2.3.0 go-yaml/yaml#571

@mikefarah
Copy link
Owner

Ah - I'm using v3 go go-yaml

@yene yene closed this as completed Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants