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

werf helm secret values does not round-trip for numbers in Yaml #5832

Open
1 task done
diesieben07 opened this issue Oct 17, 2023 · 2 comments
Open
1 task done

werf helm secret values does not round-trip for numbers in Yaml #5832

diesieben07 opened this issue Oct 17, 2023 · 2 comments

Comments

@diesieben07
Copy link

Before proceeding

  • I didn't find a similar issue

Version

1.2.248

How to reproduce

export WERF_SECRET_KEY=$(werf helm secret generate-secret-key)
echo "foo: 123" | werf helm secret values encrypt | werf helm secret values decrypt

Result

Number was changed to string:

foo: "123"

Expected result

Number remains as number:

foo: 123

Additional information

No response

@distorhead
Copy link
Member

@diesieben07 Hi!

Indeed current version of secrets parser/emitter converts numbers into strings just to preserve compatible secrets configuration within werf 1.2 versions range. First implementation of secrets was a little defective, because of this conversion. We have refactored first implementation, but currently new implementation uses compatibility mode: https://github.com/werf/werf/blob/main/pkg/secret/yaml_encoder.go#L213.

In the next big version of werf we will either fix this issue, or switch to something like sops for secrets (which also preserves original scalar yaml types).

@diesieben07
Copy link
Author

Thanks for the clarification! It's not a huge issue, I can just convert back to a number in my application. But I wanted to document it as an issue here. Glad to hear it will be fixed in the next version and thank you for your work on Werf!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants