config

package
v2.0.0-...-8eb53d6 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UUIDLabel                          = "buildkite.com/job-uuid"
	BuildURLAnnotation                 = "buildkite.com/build-url"
	JobURLAnnotation                   = "buildkite.com/job-url"
	DefaultNamespace                   = "default"
	DefaultImagePullBackOffGracePeriod = 30 * time.Second
)

Variables

View Source
var DefaultAgentImage = "ghcr.io/buildkite/agent:" + version.Version()

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug                       bool            `json:"debug"`
	JobTTL                      time.Duration   `json:"job-ttl"`
	PollInterval                time.Duration   `json:"poll-interval"`
	AgentTokenSecret            string          `json:"agent-token-secret"              validate:"required"`
	BuildkiteToken              string          `json:"buildkite-token"                 validate:"required"`
	Image                       string          `json:"image"                           validate:"required"`
	MaxInFlight                 int             `json:"max-in-flight"                   validate:"min=0"`
	Namespace                   string          `json:"namespace"                       validate:"required"`
	Org                         string          `json:"org"                             validate:"required"`
	Tags                        stringSlice     `json:"tags"                            validate:"min=1"`
	ProfilerAddress             string          `json:"profiler-address"                validate:"omitempty,hostname_port"`
	ClusterUUID                 string          `json:"cluster-uuid"                    validate:"omitempty"`
	AdditionalRedactedVars      stringSlice     `json:"additional-redacted-vars"        validate:"omitempty"`
	PodSpecPatch                *corev1.PodSpec `json:"pod-spec-patch"                  validate:"omitempty"`
	ImagePullBackOffGradePeriod time.Duration   `json:"image-pull-backoff-grace-period" validate:"omitempty"`
}

viper requires mapstructure struct tags, but the k8s types only have json struct tags. mapstructure (the module) supports switching the struct tag to "json", viper does not. So we have to have the `mapstructure` tag for viper and the `json` tag is used by the mapstructure!

func (Config) MarshalLogObject

func (c Config) MarshalLogObject(enc zapcore.ObjectEncoder) error

Jump to

Keyboard shortcuts

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