config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigName is the name of the config map for mako options.
	ConfigName = "config-mako"
)

Variables

This section is empty.

Functions

func GetOrganization

func GetOrganization() string

GetOrganization returns the organization from the configmap. It will return the defaultOrg if any error happens or it's empty.

func GetRepository

func GetRepository() string

GetRepository returns the repository from the configmap. It will return an empty string if any error happens.

func MustGetBenchmark

func MustGetBenchmark() *mpb.BenchmarkInfo

MustGetBenchmark wraps getBenchmark in log.Fatalf

func MustGetTags

func MustGetTags() []string

MustGetTags returns the additional tags from the configmap, or dies.

Types

type Channel

type Channel struct {
	Name     string `yaml:"name,omitempty"`
	Identity string `yaml:"identity,omitempty"`
}

Channel contains Slack channel's info.

func GetSlackChannels

func GetSlackChannels(benchmarkName string) []Channel

GetSlackChannels returns the slack channels to alert on for the given benchmark. If any error happens, or the config is not found, return the default channel.

type Config

type Config struct {
	// Organization holds the name of the organization for the current repository.
	Organization string

	// Repository holds the name of the repository that runs the benchmarks.
	Repository string

	// Environment holds the name of the environment,
	// where the test runs, e.g. `dev`.
	Environment string

	// List of additional tags to apply to the run.
	AdditionalTags []string

	// SlackConfig holds the slack configurations for the benchmarks,
	// it's used to determine which slack channels to alert on if there is performance regression.
	SlackConfig string
}

Config defines the mako configuration options.

func NewConfigFromConfigMap

func NewConfigFromConfigMap(configMap *corev1.ConfigMap) (*Config, error)

NewConfigFromConfigMap creates a Config from the supplied ConfigMap

func NewConfigFromMap

func NewConfigFromMap(data map[string]string) (*Config, error)

NewConfigFromMap creates a Config from the supplied map

type SlackConfig

type SlackConfig struct {
	BenchmarkChannels map[string][]Channel `yaml:"benchmarkChannels,omitempty"`
}

SlackConfig contains slack configuration for the benchmarks.

Jump to

Keyboard shortcuts

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