Azure / draft

A day 0 tool for getting your app on k8s fast
MIT License
495 stars 59 forks source link

abstract filesystem and directory operations from templating logic #126

Closed davidgamero closed 1 year ago

davidgamero commented 1 year ago

Introduce new TemplateWriter interface with the following methods:

WriteFile(string, []byte, os.FileMode) error
EnsureDirectory(string) error

This allows templates to be generated for arbitrary use cases independent of the local filesystem (ex: in-memory template generation)

Refactor dockerfile and deployment generation to use new interface, and added existing os filesystem write methods into the LocalFSWriter struct

Add TemplateWrite property to CreateCommand and set to the LocalFSWriter to maintain existing functionality