stack

package
v1.3.16 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateComponentStackMap

func CreateComponentStackMap(basePath string, filePath string) (map[string]map[string][]string, error)

CreateComponentStackMap accepts a config file and creates a map of component-stack dependencies

func FindComponentDependencies

func FindComponentDependencies(
	stack string,
	componentType string,
	component string,
	baseComponent string,
	importsConfig map[string]map[interface{}]interface{}) ([]string, error)

FindComponentDependencies finds all imports where the component or the base component is defined Component depends on the imported config file if any of the following conditions is true: 1. The imported config file has the global `vars` section and it's not empty 2. The imported config file has the component type section, which has a `vars` section which is not empty 3. The imported config file has the "components" section, which has the component type section, which has the component section 4. The imported config file has the "components" section, which has the component type section, which has the base component section

func FindComponentStacks

func FindComponentStacks(
	componentType string,
	component string,
	baseComponent string,
	componentStackMap map[string]map[string][]string) ([]string, error)

FindComponentStacks finds all infrastructure stack config files where the component or the base component is defined

func GetGlobMatches added in v1.3.2

func GetGlobMatches(pattern string) ([]string, error)

GetGlobMatches tries to read and return the Glob matches content from the sync map if it exists in the map, otherwise it finds and returns all files matching the pattern, stores the files in the map and returns the files

func ProcessConfig

func ProcessConfig(
	basePath string,
	stack string,
	config map[interface{}]interface{},
	processStackDeps bool,
	processComponentDeps bool,
	componentTypeFilter string,
	componentStackMap map[string]map[string][]string,
	importsConfig map[string]map[interface{}]interface{},
) (map[interface{}]interface{}, error)

ProcessConfig takes a raw stack config, deep-merges all variables, settings, environments and backends, and returns the final stack configuration for all Terraform and helmfile components

func ProcessYAMLConfigFile

func ProcessYAMLConfigFile(
	basePath string,
	filePath string,
	importsConfig map[string]map[interface{}]interface{}) (map[interface{}]interface{}, map[string]map[interface{}]interface{}, error)

ProcessYAMLConfigFile takes a path to a YAML config file, recursively processes and deep-merges all imports, and returns stack config as map[interface{}]interface{}

func ProcessYAMLConfigFiles

func ProcessYAMLConfigFiles(
	basePath string,
	filePaths []string,
	processStackDeps bool,
	processComponentDeps bool) ([]string, map[string]interface{}, error)

ProcessYAMLConfigFiles takes a list of paths to YAML config files, processes and deep-merges all imports, and returns a list of stack configs

Types

type BaseComponentConfig added in v1.3.10

type BaseComponentConfig struct {
	BaseComponentVars                      map[interface{}]interface{}
	BaseComponentSettings                  map[interface{}]interface{}
	BaseComponentEnv                       map[interface{}]interface{}
	FinalBaseComponentName                 string
	BaseComponentCommand                   string
	BaseComponentBackendType               string
	BaseComponentBackendSection            map[interface{}]interface{}
	BaseComponentRemoteStateBackendType    string
	BaseComponentRemoteStateBackendSection map[interface{}]interface{}
	ComponentInheritanceChain              []string
}

Jump to

Keyboard shortcuts

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