-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
dasel put --type string
not working when converting to yaml
#344
Comments
I think this is a quoting issue. I'll take a look and potentially add some more flags to enable/disable string quoting when writing values. |
Hi. I've got a similar problem. I'm modifying an existing YAML file adding some keys. After writing it out as YAML empty string are converted to nil/null instead of empty strings. So this: empty_value: "" is converted to empty_value: which ist okay most of the time - except when the code reading the YAML checks explicitly for the empty string. So keeping the type/quoting empty values would be a great option |
I've been on holiday but will try to add the flag mentioned above once I've caught up with work |
I've added a fix in a way that avoids the need for a new flag. This will be released in the next version. |
|
Describe the bug
When I'm doing this:
dasel put --type string --file values.dev.yaml --selector "annotations.previousShortSHA" -v 1615
the value comes out as a number
Expected behavior
previousShortSHA
should be"1615"
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
ubuntu, manjaro
dasel --version
):2.3.4
Additional context
I'm using ArgoCD for kubernetes and I was bitten by this when doing the following:
and it so happened that
![image](https://private-user-images.githubusercontent.com/54327698/253274471-50f0e087-ede0-45eb-a4d9-9810cbfd57a9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU0ODgxMTIsIm5iZiI6MTcyNTQ4NzgxMiwicGF0aCI6Ii81NDMyNzY5OC8yNTMyNzQ0NzEtNTBmMGUwODctZWRlMC00NWViLWE0ZDktOTgxMGNiZmQ1N2E5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA0VDIyMTAxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFjOTQ2NTFkODY3ZGE3YzY4NGU2MGJkNzBhZDIyNWUwYTg4YTM0MzgyNzk3NGViNDRjYWQxM2I0MzJmZDU5Y2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.dU3Bq3Dnc4dAgHVFbFq8ngLdwIEbqlMEj69y9ix6708)
"$(git rev-parse --short HEAD)"
returned a number:and ArgoCD threw an error because it expected a string
The text was updated successfully, but these errors were encountered: