machine

package
v0.0.0-...-ddbddba Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Expected NutanixCategory Key format: "kubernetes-io-cluster-<cluster-id>"
	NutanixCategoryKeyPrefix = "kubernetes-io-cluster-"
	NutanixCategoryValue     = "owned"
)

The expected category (key/value) for the Nutanix resources (ex. vms, images) created for the cluster

View Source
const (

	// MachineInstancePowerStateAnnotationName as annotation name for a machine instance power state
	MachineInstancePowerStateAnnotationName = "machine.openshift.io/instance-power-state"
)

Variables

This section is empty.

Functions

func GetMibValueOfQuantity

func GetMibValueOfQuantity(quantity resource.Quantity) int64

GetMibValueOfQuantity returns the given quantity value in Mib

func NutanixMachineProviderSpecFromRawExtension

func NutanixMachineProviderSpecFromRawExtension(rawExtension *runtime.RawExtension) (*machinev1.NutanixMachineProviderConfig, error)

NutanixMachineProviderSpecFromRawExtension unmarshals a raw extension into an NutanixMachineProviderConfig type

func NutanixMachineProviderStatusFromRawExtension

func NutanixMachineProviderStatusFromRawExtension(rawExtension *runtime.RawExtension) (*machinev1.NutanixMachineProviderStatus, error)

NutanixMachineProviderStatusFromRawExtension unmarshals a raw extension into an NutanixMachineProviderStatus type

func Ptr

func Ptr[T any](v T) *T

Ptr takes a pointer to the passed object.

func RawExtensionFromNutanixMachineProviderSpec

func RawExtensionFromNutanixMachineProviderSpec(spec *machinev1.NutanixMachineProviderConfig) (*runtime.RawExtension, error)

RawExtensionFromNutanixMachineProviderSpec marshals the machine provider spec.

func RawExtensionFromNutanixMachineProviderStatus

func RawExtensionFromNutanixMachineProviderStatus(status *machinev1.NutanixMachineProviderStatus) (*runtime.RawExtension, error)

RawExtensionFromNutanixMachineProviderStatus marshals the machine provider status

Types

type Actuator

type Actuator struct {
	// 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 *machinev1beta1.Machine) error

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

func (*Actuator) Delete

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

Delete deletes a machine and updates its finalizer

func (*Actuator) Exists

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

Exists determines if the given machine currently exists. A machine which is not terminated is considered as existing.

func (*Actuator) Update

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

Update attempts to sync machine state with an existing instance.

type ActuatorParams

type ActuatorParams struct {
	Client              runtimeclient.Client
	EventRecorder       record.EventRecorder
	ConfigManagedClient runtimeclient.Client
}

ActuatorParams holds parameter information for Actuator.

type BasicAuthCredential

type BasicAuthCredential struct {
	// The Basic Auth (username, password) for the Prism Central
	PrismCentral PrismCentralBasicAuth `json:"prismCentral"`

	// The Basic Auth (username, password) for the Prism Elements (clusters).
	// Currently only one Prism Element (cluster) is used for each openshift cluster.
	// Later this may spread to multiple Prism Element (cluster).
	PrismElements []PrismElementBasicAuth `json:"prismElements"`
}

type Credential

type Credential struct {
	Type CredentialType        `json:"type"`
	Data *runtime.RawExtension `json:"data"`
}

type CredentialType

type CredentialType string

Nutanix Credentials

const (
	BasicAuthCredentialType CredentialType = "basic_auth"
)

type NutanixCredentials

type NutanixCredentials struct {
	Credentials []Credential `json:"credentials"`
}

type PrismCentralBasicAuth

type PrismCentralBasicAuth struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type PrismElementBasicAuth

type PrismElementBasicAuth struct {
	Name     string `json:"name"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type Reconciler

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

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

Jump to

Keyboard shortcuts

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