util

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigManager

type ConfigManager struct {
	NodeConfig *bootstrapv1.NodeConfig
	Log        logr.Logger
	// contains filtered or unexported fields
}

ConfigManager is used to build cloud-init, BMC-meta, ...

func (*ConfigManager) Associate

func (c *ConfigManager) Associate(ctx context.Context, nConfig *bootstrapv1.NodeConfig) error

Associate associates the nodeconfig with the baremetal machine It's invoked by the Config Controller

func (*ConfigManager) CreateBareMetalHost

func (c *ConfigManager) CreateBareMetalHost(ctx context.Context) error

CreateBareMetalHost creates BMH if there is not

func (*ConfigManager) CreateNodeInitConfig

func (c *ConfigManager) CreateNodeInitConfig(ctx context.Context) (string, error)

CreateNodeInitConfig creates cloud-init

func (*ConfigManager) FindHost

func (c *ConfigManager) FindHost(ctx context.Context) (*bmh.BareMetalHost, bool)

FindHost return true when it founds the associated host by looking for an annotation on the machine that contains a reference to the host.

func (*ConfigManager) NewConfigManager

func (c *ConfigManager) NewConfigManager(client client.Client,
	nodeconfig *bootstrapv1.NodeConfig,
	configLog logr.Logger) (*ConfigManager, error)

NewConfigManager returns a new helper for managing a config

func (*ConfigManager) SetError

func (c *ConfigManager) SetError(message string)

SetError sets the ErrorMessage and ErrorReason fields on the machine and logs the message. It assumes the reason is invalid configuration, since that is currently the only relevant MachineStatusError choice.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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