env

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// WrapperShell :If host already set env like DATADISK=/data
	// This function add env to the shell, like:
	// Input shell: cat /etc/hosts
	// Output shell: DATADISK=/data cat /etc/hosts
	// So that you can get env values in you shell script
	WrapperShell(host, shell string) string
	// RenderAll :render env to all the files in dir
	RenderAll(host, dir string) error
}

func NewEnvProcessor

func NewEnvProcessor(cluster *v2.Cluster) Interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL