-
Notifications
You must be signed in to change notification settings - Fork 370
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
[Feature] Added multiple values files support for release #46
Conversation
The tests are not passing, see Travis: |
I saw that. I wonder why because, obviously, it works on my machine... I will try to figure it out. |
@rodcloutier Using external values files is currently possible using terraform's Check the following comment for details: #45 (comment) To be honest, I think there is not need for additional parameter allowing to specify path to a file. |
Thanks for your comment @burdiyan. I am aware of the To be a little clearer, the intent of the PR is not add an additional parameter allowing to specify path to a file but an additional parameter to specify paths to multiple files. We currently have multiple releases that are sharing common values. Helm allows to use several file in its command and will concatenate the values with the files. Thus we can have a common value file and a specific for each release. We then use them as such
We would like to have the same functionality in the provider, hence this PR. Does it make more sense? Note: I have renamed the PR to clarify the intent. |
@rodcloutier Oh, that makes sense. Thanks! Although I guess you could achieve this by doing something like this:
Although a bit hackie it may work. I think the problem may come if you have some clashes in variables in these multiple files, but I invite you to try it out and let us know :) |
@burdiyan I have attempted to make TF modules which use the pattern you have suggested and have experienced the problem of being unable to merge deeply nested values. I attempted this in order to be able to take general public charts and apply my company specific defaults in a Terraform module, while still allowing TF that uses the module to set project specific values. Most charts have large root keys such as This PR is a good solution to the problem of using multiple files for values and it also solves the problem of merging deeply nested keys. I would love to see this adapted to support merging multiple Personally I try to avoid using external files in my Terraform state because they can't support a multi developer workflow since they are not sourced from the locked remote state. (Two developers working on a file at once would overwrite uncommitted/unpulled changes on apply.) I think that modifying
And have it be properly merged like Helm does by default. |
I like @madmod suggestion, we should avoid read directly a file, and instead of this use @rodcloutier what do you think about this approach? |
I like @madmod approach. I’m not sure it’s possible to make this without breaking compatibility or using a separate parameter for this. It may also be a good idea to persist compiled and merged values from both set {} and raw values in the state file, but it probably worth a separate discussion. |
Interesting discussion. @madmod approach is quite interesting. I am also on the side of @burdiyan in the fact that breaking compatibility is an issue. I don't think you can have "polymorphic" values in a resource, nor that we want to handle that case. The question is how strict we want to be with compatibility break? There as already been some breaks (the recent rename) and we are not at a 1.0 release yet. We could move forward and enhance the provider at the cost of a little rework for the existing users. Too bad we had a rename from @burdiyan The PR also has the compiled and merged values in the |
We are in
|
If we are ok with @madmod suggestion, I would go ahead and change the PR to implement it. |
e09ba4e
to
904c23a
Compare
This PR intends to add support for
externalmultiple value "files".As it stands right now, the only way to use yaml values is to embed the values in the the terraform file.
With this PR, we can
reference externaluse multiple files mimicking thehelm install -f <file>
functionality.The file are specified in a list and will, as with Helm, be concatenated in order which makes value override possible. The order of resolution is:
values
content merged in orderset
valuesUsage is:
Detection of changes in the file content is done by storing amd5
hash of the content as validating with the current local file. If it does not match, the release is flagged to be updated.Note: This is an API breaking change.