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

no way to use -i option when using docker #1012

Closed
RamLavi opened this issue Nov 22, 2021 · 1 comment
Closed

no way to use -i option when using docker #1012

RamLavi opened this issue Nov 22, 2021 · 1 comment
Labels

Comments

@RamLavi
Copy link

RamLavi commented Nov 22, 2021

Describe the bug
if I try to modify in file a file then you get an error:

22:30:07 safelyRenameFile [ERRO] Failed copying from /tmp/temp3534060719 to foo
22:30:07 safelyRenameFile [ERRO] open foo: permission denied

Steps to reproduce

  1. create a file
$ cat <<EOF > foo
bar:
  - far1  
  - far2
  - falala
EOF
  1. run the docker yq command to remove some stuff:
$ docker run --rm -i -v ${PWD}:/workdir mikefarah/yq eval -i 'del( .bar[] | select(. == "far*") )' foo
22:30:07 safelyRenameFile [ERRO] Failed copying from /tmp/temp3534060719 to foo
22:30:07 safelyRenameFile [ERRO] open foo: permission denied

If you try without the -i option then there is no problem:

$ docker run --rm -i -v ${PWD}:/workdir mikefarah/yq eval 'del( .bar[] | select(. == "far*") )' foo
bar:
  - falala

Version of yq: 4.X.X
Operating system: linux
Installed via: docker

Input Yaml
Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
data.yml:

bar:
  - far1  
  - far2
  - falala

Command
The command you ran:

docker run --rm -i -v ${PWD}:/workdir mikefarah/yq eval -i 'del( .bar[] | select(. == "far*") )' foo

Actual behavior

22:30:07 safelyRenameFile [ERRO] Failed copying from /tmp/temp3534060719 to foo
22:30:07 safelyRenameFile [ERRO] open foo: permission denied
bar:
  - far1  
  - far2
  - falala

Expected behavior

bar:
  - falala

Additional context
didn't find in the manual how to handle this scenario.

@RamLavi
Copy link
Author

RamLavi commented Nov 22, 2021

sorry for the noise, looks like it is possible, as mentioned here

@RamLavi RamLavi closed this as completed Nov 22, 2021
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

1 participant