Files
sealos/pkg/env
Zihan Li 25ac669cd6 feature: sealos create support for environment variable based template rendering (#4222)
* feature: environment variable based template rendering in sealos create

* add: goimports tools

* update: goimports tools

* update: goimports tools

* fix golangci lint error

* remove docs

* remove docs

* fix: refactor template rendering logic, abstract common func

* fix ci
2023-11-02 23:44:07 +08:00
..

ENV module

This module will merge the host env and global env, then render env into cloudrootfs templates or set env when exec a shell command and script.

ENV template render

ENV module only render the filename has ".tmpl" suffix, and render the result into a new file.

Like: test.yaml.tmpl -> test.yaml

test.yaml.tmpl:

{{ .foo }}

render result, test.yaml:

bar

Shell ENV

Add ENV value to each shell command.

Raw shell command:

cat /etc/hosts

WrapperShell:

foo=bar cat /etc/hosts