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

file provisioner: add possibility to set content + tests #11209

Merged
merged 1 commit into from
Aug 17, 2021

Conversation

azr
Copy link
Contributor

@azr azr commented Aug 16, 2021

No description provided.

@azr azr requested a review from a team as a code owner August 16, 2021 13:39
@azr azr mentioned this pull request Aug 16, 2021
@michelzanini
Copy link

Thanks for the PR!

Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I left a small suggestion around the handling of the a file download, but this is otherwise good to go.

errors.New("source, sources or content must be specified."))
}

if len(p.config.Sources) > 0 && p.config.Content != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to error if a user is trying to use direction "download" along with the new content field. Or maybe just provide a warning to the user that "content" will be ignored when downloading a file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ehm, good question, yeah, it's probably a problem to do that, because it will basically create a file locally with content but at the same time if a user would be using that option, then they probably know what they are doing 🤔 . Because the default is alway to upload.

Let's leave it like this and if this turns out to be a problem, we can open a new PR to error there.

@azr azr merged commit 1d915ad into master Aug 17, 2021
@azr azr deleted the azr/file_p_string_content_upload branch August 17, 2021 09:24
@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants