options

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package options provides the flags used for the minerset controller.

Index

Constants

View Source
const (
	// ControllerUserAgent is the userAgent name when starting onex-minerset controller.
	ControllerUserAgent = "onex-minerset-controller"
)

Variables

This section is empty.

Functions

func LoadConfigFromFile

func LoadConfigFromFile(file string) (*config.MinerSetControllerConfiguration, error)

func LogOrWriteConfig

func LogOrWriteConfig(fileName string, cfg *config.MinerSetControllerConfiguration) error

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

Types

type Options

type Options struct {
	// ConfigFile is the location of the minerset controller server's configuration file.
	ConfigFile string

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

	// The address of the Kubernetes API server (overrides any value in kubeconfig).
	Master string

	// Path to kubeconfig file with authorization and master location information.
	Kubeconfig string

	Logs *logs.Options
	// contains filtered or unexported fields
}

Options is the main context object for the onex-minerset controller.

func NewOptions

func NewOptions() (*Options, error)

NewOptions creates a new Options with a default config.

func (*Options) ApplyDeprecated

func (o *Options) ApplyDeprecated()

ApplyDeprecated obtains the deprecated CLI args and set them to `o.ComponentConfig` if specified.

func (*Options) ApplyTo

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

ApplyTo fills up minerset controller config with options.

func (*Options) Complete

func (o *Options) Complete() error

Complete completes all the required options.

func (*Options) Config

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

Config return a minerset controller config object.

func (*Options) Flags

func (o *Options) Flags() (fss cliflag.NamedFlagSets)

Flags returns flags for a specific APIServer by section name.

func (*Options) Validate

func (o *Options) Validate() error

Validate is used to validate the options and config before launching the controller.

Jump to

Keyboard shortcuts

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