config

package
v0.0.0-...-a426a1e Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorEmptyFile indicates that manifest file was empty.
	// Useful to distinguish where the manifast was empty or malformed.
	ErrorEmptyFile = errors.New("emptyfile")
)

Functions

func GetFuncs

func GetFuncs() template.FuncMap

GetFuncs returns map of names to functions, that are supported by template provider.

func GetMapping

func GetMapping(clusterLoaderConfig *ClusterLoaderConfig) (map[string]interface{}, *errors.ErrorList)

GetMapping returns template variable mapping for the given ClusterLoaderConfig.

func LoadCL2Envs

func LoadCL2Envs() (map[string]interface{}, error)

LoadCL2Envs returns mapping from the envs starting with CL2_ prefix.

func LoadTestOverrides

func LoadTestOverrides(paths []string) (map[string]interface{}, error)

LoadTestOverrides returns mapping from file specified by the given paths.

func LoadTestSuite

func LoadTestSuite(path string) (api.TestSuite, error)

LoadTestSuite creates test suite config from file specified by the given path.

func MergeMappings

func MergeMappings(a, b map[string]interface{}) error

MergeMappings modifies map b to contain all new key=value pairs from b. It will return error in case of conflict, i.e. if exists key k for which a[k] != b[k]

Types

type ClusterConfig

type ClusterConfig struct {
	KubeConfigPath             string
	Nodes                      int
	Provider                   string
	EtcdInsecurePort           int
	MasterIPs                  []string
	MasterInternalIPs          []string
	MasterName                 string
	KubemarkRootKubeConfigPath string
	DeleteStaleNamespaces      bool
}

ClusterConfig is a structure that represents cluster description.

func (*ClusterConfig) GetMasterInternalIp

func (c *ClusterConfig) GetMasterInternalIp() string

GetMasterInternalIp returns the first internal master ip, added for backward compatibility. TODO(mmatt): Remove this method once all the codebase is migrated to support multiple masters.

func (*ClusterConfig) GetMasterIp

func (c *ClusterConfig) GetMasterIp() string

GetMasterIp returns the first master ip, added for backward compatibility. TODO(mmatt): Remove this method once all the codebase is migrated to support multiple masters.

type ClusterLoaderConfig

type ClusterLoaderConfig struct {
	ClusterConfig     ClusterConfig
	ReportDir         string
	EnableExecService bool
	TestScenario      api.TestScenario
	PrometheusConfig  PrometheusConfig
}

ClusterLoaderConfig represents all single test run parameters used by CLusterLoader.

type PrometheusConfig

type PrometheusConfig struct {
	EnableServer       bool
	TearDownServer     bool
	ScrapeEtcd         bool
	ScrapeNodeExporter bool
	ScrapeKubelets     bool
	ScrapeKubeProxy    bool
}

PrometheusConfig represents all flags used by prometheus.

type TemplateProvider

type TemplateProvider struct {
	// contains filtered or unexported fields
}

TemplateProvider provides object templates. Templates in unstructured form are served by reading file from given path or by using cache if available.

func NewTemplateProvider

func NewTemplateProvider(basepath string) *TemplateProvider

NewTemplateProvider creates new template provider.

func (*TemplateProvider) RawToObject

func (tp *TemplateProvider) RawToObject(path string) (*unstructured.Unstructured, error)

RawToObject creates object from file specified by the given path or uses cached object if available.

func (*TemplateProvider) TemplateInto

func (tp *TemplateProvider) TemplateInto(path string, mapping map[string]interface{}, obj interface{}) error

TemplateInto decodes template specified by the given path into given structure.

func (*TemplateProvider) TemplateToConfig

func (tp *TemplateProvider) TemplateToConfig(path string, mapping map[string]interface{}) (*api.Config, error)

TemplateToConfig creates test config from file specified by the given path. Template's placeholders are replaced based on provided mapping.

func (*TemplateProvider) TemplateToObject

func (tp *TemplateProvider) TemplateToObject(path string, mapping map[string]interface{}) (*unstructured.Unstructured, error)

TemplateToObject creates object from file specified by the given path or uses cached object if available. Template's placeholders are replaced based on provided mapping.

Jump to

Keyboard shortcuts

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