options

package
v0.32.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Injectables = []Injectable{&Options{}}
)

Functions

func ToContext added in v0.32.0

func ToContext(ctx context.Context, opts *Options) context.Context

Types

type FeatureGates added in v0.32.0

type FeatureGates struct {
	Drift bool
	// contains filtered or unexported fields
}

func ParseFeatureGates added in v0.32.0

func ParseFeatureGates(gateStr string) (FeatureGates, error)

type FlagSet added in v0.32.0

type FlagSet struct {
	*flag.FlagSet
}

func (*FlagSet) BoolVarWithEnv added in v0.32.0

func (fs *FlagSet) BoolVarWithEnv(p *bool, name string, envVar string, val bool, usage string)

BoolVarWithEnv defines a bool flag with a specified name, default value, usage string, and fallback environment variable.

type Injectable added in v0.32.0

type Injectable interface {
	// AddFlags adds the injectable's flags to karpenter's flag set
	AddFlags(*FlagSet)
	// Parse parses the flag set and handles any required post-processing on
	// the flags
	Parse(*FlagSet, ...string) error
	// ToContext injects the callee into the given context
	ToContext(context.Context) context.Context
	// MergeSettings extracts settings from the given context and merges them
	// with the options in-place. Values that were previously set by CLI flags
	// or environment variables take precedent over settings.
	// TODO: Remove with karpenter-global-settings
	MergeSettings(context.Context)
}

Injectable defines a set of flag based options to be parsed and injected into Karpenter's contexts

type Options

type Options struct {
	ServiceName          string
	DisableWebhook       bool
	WebhookPort          int
	MetricsPort          int
	WebhookMetricsPort   int
	HealthProbePort      int
	KubeClientQPS        int
	KubeClientBurst      int
	EnableProfiling      bool
	EnableLeaderElection bool
	MemoryLimit          int64
	LogLevel             string
	BatchMaxDuration     time.Duration
	BatchIdleDuration    time.Duration
	FeatureGates         FeatureGates
	// contains filtered or unexported fields
}

Options contains all CLI flags / env vars for karpenter-core. It adheres to the options.Injectable interface.

func FromContext added in v0.32.0

func FromContext(ctx context.Context) *Options

func (*Options) AddFlags added in v0.32.0

func (o *Options) AddFlags(fs *FlagSet)

func (*Options) MergeSettings added in v0.32.0

func (o *Options) MergeSettings(ctx context.Context)

func (*Options) Parse added in v0.32.0

func (o *Options) Parse(fs *FlagSet, args ...string) error

func (*Options) ToContext added in v0.32.0

func (o *Options) ToContext(ctx context.Context) context.Context

Jump to

Keyboard shortcuts

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