vsphere

package
v0.2.1-0...-e2b4537 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 37 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	GuestInfoIgnitionData     = "guestinfo.ignition.config.data"
	GuestInfoIgnitionEncoding = "guestinfo.ignition.config.data.encoding"
	GuestInfoHostname         = "guestinfo.hostname"
	GuestInfoNetworkKargs     = "guestinfo.afterburn.initrd.network-kargs"
	StealClock                = "stealclock.enable"
)

These are the guestinfo variables used by Ignition. https://access.redhat.com/documentation/en-us/openshift_container_platform/4.1/html/installing/installing-on-vsphere

Variables

This section is empty.

Functions

func EncodeIgnitionConfig

func EncodeIgnitionConfig(data []byte) string

EncodeIgnitionConfig attempts to decode the given data until it looks to be plain-text, then returns a base64 encoded version of that plain-text.

func IgnitionConfig

func IgnitionConfig(data []byte) []types.BaseOptionValue

IgnitionConfig returns a slice of option values that set the given data as the guest's ignition config.

func ProviderSpecFromRawExtension

func ProviderSpecFromRawExtension(rawExtension *runtime.RawExtension) (*machinev1.VSphereMachineProviderSpec, error)

ProviderSpecFromRawExtension unmarshals the JSON-encoded spec

func ProviderStatusFromRawExtension

func ProviderStatusFromRawExtension(rawExtension *runtime.RawExtension) (*machinev1.VSphereMachineProviderStatus, error)

ProviderStatusFromRawExtension unmarshals a raw extension into a VSphereMachineProviderStatus type

func RawExtensionFromProviderSpec

func RawExtensionFromProviderSpec(spec *machinev1.VSphereMachineProviderSpec) (*runtime.RawExtension, error)

RawExtensionFromProviderSpec marshals the machine provider spec.

func RawExtensionFromProviderStatus

func RawExtensionFromProviderStatus(status *machinev1.VSphereMachineProviderStatus) (*runtime.RawExtension, error)

RawExtensionFromProviderStatus marshals the provider status

Types

type Actuator

type Actuator struct {
	TaskIDCache                map[string]string
	StaticIPFeatureGateEnabled bool
	// contains filtered or unexported fields
}

Actuator is responsible for performing machine reconciliation.

func NewActuator

func NewActuator(params ActuatorParams) *Actuator

NewActuator returns an actuator.

func (*Actuator) Create

func (a *Actuator) Create(ctx context.Context, machine *machinev1.Machine) error

Create creates a machine and is invoked by the machine controller.

func (*Actuator) Delete

func (a *Actuator) Delete(ctx context.Context, machine *machinev1.Machine) error

func (*Actuator) Exists

func (a *Actuator) Exists(ctx context.Context, machine *machinev1.Machine) (bool, error)

func (*Actuator) Update

func (a *Actuator) Update(ctx context.Context, machine *machinev1.Machine) error

type ActuatorParams

type ActuatorParams struct {
	Client                     runtimeclient.Client
	APIReader                  runtimeclient.Reader
	EventRecorder              record.EventRecorder
	TaskIDCache                map[string]string
	StaticIPFeatureGateEnabled bool
}

ActuatorParams holds parameter information for Actuator.

type Global

type Global struct {
	// Port is the port on which the vSphere endpoint is listening.
	// Defaults to 443.
	// Has string type because we need empty string value for formatting
	Port         string `gcfg:"port"`
	InsecureFlag string `gcfg:"insecure-flag"`
}

Global is the vSphere cloud provider's global configuration.

type Labels

type Labels struct {
	// Zone is the zone in which VMs are created/located.
	Zone string `gcfg:"zone"`
	// Region is the region in which VMs are created/located.
	Region string `gcfg:"region"`
}

Labels is the vSphere cloud provider's zone and region configuration.

type NetworkStatus

type NetworkStatus struct {
	// Connected is a flag that indicates whether this network is currently
	// connected to the VM.
	Connected bool

	// IPAddrs is one or more IP addresses reported by vm-tools.
	IPAddrs []string

	// MACAddr is the MAC address of the network device.
	MACAddr string

	// NetworkName is the name of the network.
	NetworkName string
}

type Reconciler

type Reconciler struct {
	// contains filtered or unexported fields
}

Reconciler runs the logic to reconciles a machine resource towards its desired state

func (Reconciler) GetSession

func (s Reconciler) GetSession() *session.Session

func (Reconciler) GetUserData

func (s Reconciler) GetUserData() ([]byte, error)

GetUserData fetches the user-data from the secret referenced in the Machine's provider spec, if one is set.

func (Reconciler) PatchMachine

func (s Reconciler) PatchMachine() error

Patch patches the machine spec and machine status after reconciling.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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