-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
Split into files uses .yml
file ending
#1165
Comments
Ah I see - I should have done that from the start. I'm reluctant to do this now as users already have scripts that assume '.yml'. Since this is seems to be only a preference of the standards and |
Hmm, so a change for When I noticed So perhaps a flag to disable the addition of a file ending would be a worthwhile addition? Besides allowing the proper |
Actually that's not a bad idea - if the resulting contains ".yaml" or ".yml" then I can skip over adding a ".yml" |
Introducing that without a flag still might break some scripts though :/ Which is why I suggested a flag (which has the added benefit of allowing any file ending) |
I use the split feature to separate |
@joebowbeer A workaround is to use kubectl-slice kubectl slice -f source.yaml -t '{{.metadata.name | lower}}.yaml' -o ./source |
Fixed in v4.25.3 - if you have an extension in the split-file-exp it will no longer add '.yml' |
so how do you use that? And how do you specify an output dir? |
@bluebrown By defining a path as part of the filename given in $ mkdir dir/
$ echo '[1,2,3]' | yq '.[]' - --split-exp='"dir/test-" + . + ".yaml"'
$ ls dir/
test-1.yaml test-2.yaml test-3.yaml |
Any idea how to let Workaroundfor name in $(yq eval '.metadata.name' manifests.yaml | grep -v '^---$' | awk '!seen[$0]++'); do mkdir -p "$name"; done
|
Describe the bug
Files created by
--split-exp
use the.yml
file ending althoguhyaml
is the recommended file endingVersion of yq: 4.24.2
Operating system: linux
Installed via: homebrew
Command
The command you ran:
Actual behavior
The files
file-1.yml
,file-2.yml
andfile-3.yml
where created
Expected behavior
The files
file-1.yaml
,file-2.yaml
andfile-3.yaml
are created
Additional context
If there are other cases where
yq
creates new files, I suspect the.yml
ending might be in use as wellThe text was updated successfully, but these errors were encountered: