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

provider/template: Added single part support to datasource cloudinit template. #8994

Closed

Conversation

cgroschupp
Copy link

Some implementations from cloud-init does not support multi parts (e.g. coreos-cloudinit).

@apparentlymart
Copy link
Member

Hi @cgroschupp! Thanks for the work here.

I'd like to understand a little more about the use-case here, since as far as I was aware the multipart MIME encoding was the primary reason for this data source to exist... if you're just generating a single part, could you not just use directly whatever value you would've passed to content in the single part you'd provide?

@cgroschupp
Copy link
Author

Hi @apparentlymart
coreos-cloudinit supports only one plain part, i don't have find a way to create the template without mime.

See also the "cloud_datasource_init_config" tests.

@kwilczynski
Copy link
Contributor

@cgroschupp hi there! I believe "single part" is just a flat file, and using template_file should suffice.

@cgroschupp
Copy link
Author

@kwilczynski but template_file can't creating gzip content.
See also comment from @paultyng in pr #3858 and issue #3407

@apparentlymart
Copy link
Member

Ahh, I see. So really this is just a gzip function implemented as a data source...

I raised some concerns in that other issue about whether Terraform could losslessly persist gzip binary data in JSON. Given that we already do this for this resource, can I assume that it is actually working properly?

One interesting thing about data resources, which didn't exist at the time I wrote those comments, is that in most cases we don't use the values cached in state because they get rebuild during the refresh phase. So if it were to break in the way I was expecting, it would be only if -refresh=false were specified to force Terraform to use the cached values in state.

* Added gzip and base64 tests.
@cgroschupp
Copy link
Author

For me gzip+base64 works fine, i have no experiences with only gzip. But i have added tests for both cases.

@teamterraform
Copy link
Contributor

Hi folks! We are working on general github issue/PR cleanup. I am going to close this PR. If this is still something that needs to be done, the terraform template provider is in its own repository.

@ghost
Copy link

ghost commented Sep 5, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants