options

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Overview

Package options provides the descheduler flags

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogOrWriteConfig

func LogOrWriteConfig(fileName string, cfg *deschedulerconfig.DeschedulerConfiguration, completedProfiles []deschedulerconfig.DeschedulerProfile) error

LogOrWriteConfig logs the completed component config and writes it into the given file name as YAML, if either is enabled

Types

type CombinedInsecureServingOptions

type CombinedInsecureServingOptions struct {
	Healthz *apiserveroptions.DeprecatedInsecureServingOptions
	Metrics *apiserveroptions.DeprecatedInsecureServingOptions

	BindPort    int    // overrides the structs above on ApplyTo, ignored on ApplyToFromLoadedConfig
	BindAddress string // overrides the structs above on ApplyTo, ignored on ApplyToFromLoadedConfig
}

CombinedInsecureServingOptions sets up to two insecure listeners for healthz and metrics. The flags override the ComponentConfig and DeprecatedInsecureServingOptions values for both.

func (*CombinedInsecureServingOptions) AddFlags

func (o *CombinedInsecureServingOptions) AddFlags(fs *pflag.FlagSet)

AddFlags adds flags for the insecure serving options.

func (*CombinedInsecureServingOptions) ApplyTo

ApplyTo applies the insecure serving options to the given scheduler app configuration, and updates the componentConfig.

func (*CombinedInsecureServingOptions) ApplyToFromLoadedConfig

ApplyToFromLoadedConfig updates the insecure serving options from the component config and then applies it to the given scheduler app configuration.

func (*CombinedInsecureServingOptions) Validate

func (o *CombinedInsecureServingOptions) Validate() []error

Validate validates the insecure serving options.

type Options

type Options struct {
	ComponentConfig *deschedulerconfig.DeschedulerConfiguration

	LeaderElection          *componentbaseconfig.LeaderElectionConfiguration
	SecureServing           *apiserveroptions.SecureServingOptionsWithLoopback
	CombinedInsecureServing *CombinedInsecureServingOptions
	Metrics                 *metrics.Options
	Logs                    *logs.Options

	// ConfigFile is the location of the scheduler server's configuration file.
	ConfigFile string

	// WriteConfigTo is the path where the default configuration will be written.
	WriteConfigTo string

	// Flags hold the parsed CLI flags.
	Flags *cliflag.NamedFlagSets

	Client clientset.Interface
}

Options has all the params needed to run a Scheduler

func NewOptions

func NewOptions() *Options

NewOptions returns default scheduler app options.

func (*Options) ApplyLeaderElectionTo

func (o *Options) ApplyLeaderElectionTo(cfg *deschedulerconfig.DeschedulerConfiguration)

ApplyLeaderElectionTo obtains the CLI args related with leaderelection, and override the values in `cfg`. Then the `cfg` object is injected into the `options` object.

func (*Options) ApplyTo

func (o *Options) ApplyTo(c *deschedulerappconfig.Config) error

ApplyTo applies the scheduler options to the given scheduler app configuration.

func (*Options) Config

func (o *Options) Config() (*deschedulerappconfig.Config, error)

Config return a scheduler config object

func (*Options) Validate

func (o *Options) Validate() []error

Validate validates all the required options.

Jump to

Keyboard shortcuts

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