sunpikeutils

package
v0.0.0-...-a954c3e Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Wrapper

type Wrapper struct {
	Host *sunpikev1alpha1.Host
	// contains filtered or unexported fields
}

Wrapper struct encapsulates api.Host object to simplify sunpike communication

func InitOrGetSunpikeClient

func InitOrGetSunpikeClient(phases []phases.PhaseInterface, cfg config.Config, hostSpec sunpikev1alpha1.HostSpec) (*Wrapper, error)

InitOrGetSunpikeClient returns an instance of the sunpike.Wrapper

cfg contains the configuration needed to setup the Sunpike client, such as transport URL and the connection timeout. hostSpec on the other hand is optional and is what this Sunpike client will send to Nodelet as the Spec as part of the status update.

The idea is to also incorporate the settings of cfg into the HostSpec. After merging those we can remove the need for the cfg argument. TODO merge cfg and hostSpec at some point

func (*Wrapper) GetOrderForPhaseName

func (c *Wrapper) GetOrderForPhaseName(name string) int32

GetOrderForPhaseName is a convenience function to convert phase name to phase order This function is needed because pre-sunpike nodelet was entirely using phase names for UI simplicity. The new data model however uses phase order since it is a unique identifier

func (*Wrapper) Update

Update is a convenience function to convert extension data into api.Host object and report it to sunpike

Jump to

Keyboard shortcuts

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