Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
Description
Puppet Version: Puppet 4 (at least) and up
Puppet Server Version: n/a
OS Name/Version: all
When running puppet apply with a file resource and source parameter, then puppet will load the entire file into memory, instead of streaming it.
This was noticed while researching why the bug described in PUP-7482 only affected puppet agent but not puppet apply.
Desired Behavior:
When managing files with a source parameter, puppet apply should always stream file content from all of the following sources
<absolute path> local file
file://<URI-encoded path> local file
puppet:///modules/mymodule local file
http?://host:port/path/to/file remote file
Actual Behavior:
puppet apply does not stream file content from http-based sources. See https://github.com/puppetlabs/puppet/blob/5.3.3/lib/puppet/type/file/source.rb#L274-L276.
At first glance it appears the Puppet::Type::File::ParameterSource#content method can be deleted entirely, and should always rely on chunk_file_from_disk or chunk_file_from_source.