Files
sealos/pkg/env
fengxsongandcuisongliu 95493cfa3e Sweep: run guest command one by one and support run patch-type image (#3677)
* refactor: run guest command one by one and support run patch-type image

Signed-off-by: fengxsong <fengxsong@outlook.com>

* fix: ci lints and remove mounts parameter

Signed-off-by: fengxsong <fengxsong@outlook.com>

* fix: test case

Signed-off-by: fengxsong <fengxsong@outlook.com>

* fix: vip address rendering

Signed-off-by: fengxsong <fengxsong@outlook.com>

* fix: test case

Signed-off-by: fengxsong <fengxsong@outlook.com>

* feature(main): add test case

Signed-off-by: cuisongliu <cuisongliu@qq.com>

* fix: inject rootfs env into bootstrap process

Signed-off-by: fengxsong <fengxsong@outlook.com>

* feature(main): add join using guest process

Signed-off-by: cuisongliu <cuisongliu@qq.com>

* fix: add targetHosts parameter as guest commands are not always applied to all hosts

Signed-off-by: fengxsong <fengxsong@outlook.com>

* feature(main): add patch image

Signed-off-by: cuisongliu <cuisongliu@qq.com>

* refactor: add context parameter and pass it along side to the end

Signed-off-by: fengxsong <fengxsong@outlook.com>

* test(main): add test for patch image

Signed-off-by: cuisongliu <cuisongliu@qq.com>

* test(main): add test for patch image

Signed-off-by: cuisongliu <cuisongliu@qq.com>

* test(main): add test for patch image

Signed-off-by: cuisongliu <cuisongliu@qq.com>

* test(main): add test for patch image

Signed-off-by: cuisongliu <cuisongliu@qq.com>

---------

Signed-off-by: fengxsong <fengxsong@outlook.com>
Signed-off-by: cuisongliu <cuisongliu@qq.com>
Co-authored-by: cuisongliu <cuisongliu@qq.com>
2023-08-17 21:23:04 +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