vsphere

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

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

Go to latest
Published: Sep 17, 2025 License: Apache-2.0 Imports: 42 Imported by: 0

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

View Source
const (
	OpenshiftConfigNamespace = "openshift-config"
)

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 GetInfrastructure

func GetInfrastructure(c runtimeclient.Reader) (*configv1.Infrastructure, error)

GetInfrastructure retrieves the Infrastructure object from the provided API reader. It returns an error if the API reader is nil or if there's an issue fetching the Infrastructure.

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
	FeatureGates featuregate.MutableFeatureGate
	// 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
	FeatureGates             featuregate.MutableFeatureGate
	OpenshiftConfigNamespace string
}

ActuatorParams holds parameter information for Actuator.

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