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

Add basic one-shot tera support, to enable use of environmental varia… #296

Closed
wants to merge 2 commits into from

Conversation

peter-oneill
Copy link

@peter-oneill peter-oneill commented Jul 4, 2023

Alternative to PR for regex-based implementation

Why this change?

This allows users to use Tera templating for additional flexibility with their floki.yaml. The target use case is to reference environmental variables in floki.yaml, for example to mount a $HOME subdirectory in a container as

docker-switches:
  - -v {{ get_env(name='HOME' }}/.vim:/home/build/.vim

Relevant testing

  • New UT added,
  • Tested manually against a local floki.yaml file which successfully mounted a directory declared as {{ get_env('HOME) }}, and similarly printed a host environmental variable in the container in an init command.

Contributor notes

See Teams chat for idea discussion.
Subsequently discussed using Tera with Max

Checks

  • New/modified Rust code formatted with cargo fmt
  • Documentation and README.md updated for this change, if necessary
    • Documentation, not readme, as this is more advanced use.
  • CHANGELOG.md updated for this change

@maxdymond
Copy link
Collaborator

Fixed in another PR.

@maxdymond maxdymond closed this Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants