ContainerFileTemplate currently accepts the path to a file, we've encountered use cases where we want to pass the file contents rather. For example, when the file content is created as part of the charm code like creating the certs.
At the moment, the workaround for this is to create a temp file and pass the path of the temp file to ContainerFileTemplate i.e. read the temp file back in.
Example of the workaround.
What needs to get done
modify the pebble component to accept file contents rather than just file paths in files_to_push
Definition of Done
we can pass the file content to files_to_push
tests are added for passing file content
refactor the charms where we are doing the workaround mentioned in the context.
Context
ContainerFileTemplate
currently accepts the path to a file, we've encountered use cases where we want to pass the file contents rather. For example, when the file content is created as part of the charm code like creating the certs. At the moment, the workaround for this is to create a temp file and pass the path of the temp file toContainerFileTemplate
i.e. read the temp file back in. Example of the workaround.What needs to get done
modify the pebble component to accept file contents rather than just file paths in
files_to_push
Definition of Done
files_to_push