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 is not able to stat my file #463

Closed
allamand opened this issue Jun 12, 2020 · 5 comments
Closed

yq is not able to stat my file #463

allamand opened this issue Jun 12, 2020 · 5 comments
Labels

Comments

@allamand
Copy link

Describe the bug
I want to use yq to update a yaml file, but yq cannot stat the file while stat is correctly working

I can stat the file directly

demo3:~/environment/eks/kubeflow/eksworkshop-eksctl $ stat /home/ec2-user/environment/eks/kubeflow/eksworkshop-eksctl/kfctl_aws.yaml                           
  File: ‘/home/ec2-user/environment/eks/kubeflow/eksworkshop-eksctl/kfctl_aws.yaml’
  Size: 8832            Blocks: 24         IO Block: 4096   regular file
Device: 10301h/66305d   Inode: 288235      Links: 1
Access: (0664/-rw-rw-r--)  Uid: (  501/ec2-user)   Gid: (  501/ec2-user)
Access: 2020-06-12 08:47:09.819085462 +0000
Modify: 2020-06-12 08:49:41.190943240 +0000
Change: 2020-06-12 08:49:41.190943240 +0000
 Birth: -

but yq respond a stat error

demo3:~/environment/eks/kubeflow/eksworkshop-eksctl $ yq w -i ${CONFIG_FILE} 'spec.plugins[0].spec.enablePodIamPolicy' true 
Error: stat /home/ec2-user/environment/eks/kubeflow/eksworkshop-eksctl/kfctl_aws.yaml: no such file or directory
...
09:11:27 main [ERRO] stat /home/ec2-user/environment/eks/kubeflow/eksworkshop-eksctl/kfctl_aws.yaml: no such file or directory
demo3:~/environment/eks/kubeflow/eksworkshop-eksctl $ 

Is there a constraint in yq preventing to correctly stat file ?

@allamand allamand added the bug label Jun 12, 2020
@mikefarah
Copy link
Owner

Only thing I can think of is if you are using yq installed via snap - snap has a concept of 'confinements' that may be causing this?

@allamand
Copy link
Author

I'm not using snap, but i'm using docker image that may explain the problem

yq() {
  docker run --rm -i -v "${PWD}":/workdir mikefarah/yq yq "$@"                
}

@allamand
Copy link
Author

it's because I just mount my local folder.

@cnoble40-netrist
Copy link

@allamand What was the issue? I'm having same issue...it can't find the Chart.yaml even though it's in the current directory that's mounted to /workdir

@jnbptstm
Copy link

jnbptstm commented Sep 1, 2021

@cnoble40-netrist May be due to Snap confinement as @mikefarah wrote. Documentation says yq installs with strict confinement. Try with: cat Chart.yaml | yq e -

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

4 participants