Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement machinebroker / API updates / ori updates #532

Merged
merged 4 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 68 additions & 7 deletions apis/compute/machine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type Volume struct {

// VolumeSource specifies the source to use for a Volume.
type VolumeSource struct {
// VolumeRef instructs the Volume to use the specified Volume for the attachment.
// VolumeRef instructs to use the specified Volume as source for the attachment.
VolumeRef *corev1.LocalObjectReference
// EmptyDisk instructs to use a Volume offered by the machine pool provider.
EmptyDisk *EmptyDiskVolumeSource
Expand All @@ -115,16 +115,36 @@ type EmptyDiskVolumeSource struct {
type NetworkInterfaceStatus struct {
// Name is the name of the NetworkInterface to whom the status belongs to.
Name string
// Phase is the NetworkInterface binding phase of the NetworkInterface.
Phase NetworkInterfacePhase
// LastPhaseTransitionTime is the last time the Phase transitioned.
LastPhaseTransitionTime *metav1.Time
// NetworkHandle is the handle of the network the NetworkInterface is in.
NetworkHandle string
// IPs are the ips allocated for the network interface.
IPs []commonv1alpha1.IP
// VirtualIP is the virtual ip allocated for the network interface.
VirtualIP *commonv1alpha1.IP
// State represents the attachment state of a NetworkInterface.
State NetworkInterfaceState
// LastStateTransitionTime is the last time the State transitioned.
LastStateTransitionTime *metav1.Time
// Phase is the NetworkInterface binding phase of the NetworkInterface.
Phase NetworkInterfacePhase
// LastPhaseTransitionTime is the last time the Phase transitioned.
LastPhaseTransitionTime *metav1.Time
}

// NetworkInterfaceState is the infrastructure attachment state a NetworkInterface can be in.
type NetworkInterfaceState string

const (
// NetworkInterfaceStatePending indicates that the attachment of a network interface is pending.
NetworkInterfaceStatePending NetworkInterfaceState = "Pending"
// NetworkInterfaceStateAttached indicates that a network interface has been successfully attached.
NetworkInterfaceStateAttached NetworkInterfaceState = "Attached"
// NetworkInterfaceStateError indicates that there was an error during attaching a network interface.
NetworkInterfaceStateError NetworkInterfaceState = "Error"
// NetworkInterfaceStateDetached indicates that a network interface has been successfully detached.
NetworkInterfaceStateDetached NetworkInterfaceState = "Detached"
)

// NetworkInterfacePhase represents the binding phase a NetworkInterface can be in.
type NetworkInterfacePhase string

Expand All @@ -135,18 +155,58 @@ const (
NetworkInterfacePhaseBound NetworkInterfacePhase = "Bound"
)

// EmptyDiskVolumeStatus is the status of an EmptyDiskVolumeSource Volume.
type EmptyDiskVolumeStatus struct {
// Size is the current size of the volume, if any discrete size is available.
Size *resource.Quantity
}

type ReferencedVolumeStatus struct {
// Driver is the driver used for the volume.
Driver string
// Handle is the unique provider handle of the volume.
Handle string
}

type VolumeSourceStatus struct {
// EmptyDisk indicates the empty disk status of the volume if it's from an empty disk source.
EmptyDisk *EmptyDiskVolumeStatus
// Referenced is the status of a referenced volume (either VolumeSource.Ephemeral or VolumeSource.VolumeRef).
Referenced *ReferencedVolumeStatus
}

// VolumeStatus is the status of a Volume.
type VolumeStatus struct {
// Name is the name of a volume attachment.
Name string
// Device is the device the volume is mounted with on the host.
Device string
// VolumeSourceStatus is the status of the configuration of the volume specified as source.
VolumeSourceStatus
// State represents the attachment state of a Volume.
State VolumeState
// LastStateTransitionTime is the last time the State transitioned.
LastStateTransitionTime *metav1.Time
// Phase represents the binding phase of a Volume.
Phase VolumePhase
// LastPhaseTransitionTime is the last time the Phase transitioned.
LastPhaseTransitionTime *metav1.Time
// DeviceID is the disk device ID on the host.
DeviceID string
}

// VolumeState is the infrastructure attachment state a Volume can be in.
type VolumeState string

const (
// VolumeStatePending indicates that the attachment of a volume is pending.
VolumeStatePending VolumeState = "Pending"
// VolumeStateAttached indicates that a volume has been successfully attached.
VolumeStateAttached VolumeState = "Attached"
// VolumeStateError indicates that there was an error during attaching a volume.
VolumeStateError VolumeState = "Error"
// VolumeStateDetached indicates that a volume has been successfully detached.
VolumeStateDetached VolumeState = "Detached"
)

// VolumePhase represents the binding phase a Volume can be in.
type VolumePhase string

Expand Down Expand Up @@ -234,6 +294,7 @@ type MachineList struct {
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:conversion-gen:explicit-from=net/url.Values

// MachineExecOptions is the query options to a Machine's remote exec call
type MachineExecOptions struct {
Expand Down
74 changes: 67 additions & 7 deletions apis/compute/v1alpha1/machine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type MachineSpec struct {
NetworkInterfaces []NetworkInterface `json:"networkInterfaces,omitempty"`
// Volumes are volumes attached to this machine.
Volumes []Volume `json:"volumes,omitempty"`
// IgnitionRef is a reference to a config map containing the ignition YAML for the machine to boot up.
// IgnitionRef is a reference to a secret containing the ignition YAML for the machine to boot up.
// If key is empty, DefaultIgnitionKey will be used as fallback.
IgnitionRef *commonv1alpha1.SecretKeySelector `json:"ignitionRef,omitempty"`
// EFIVars are variables to pass to EFI while booting up.
Expand Down Expand Up @@ -116,16 +116,36 @@ type EmptyDiskVolumeSource struct {
type NetworkInterfaceStatus struct {
// Name is the name of the NetworkInterface to whom the status belongs to.
Name string `json:"name"`
// Phase is the NetworkInterface binding phase of the NetworkInterface.
Phase NetworkInterfacePhase `json:"phase,omitempty"`
// LastPhaseTransitionTime is the last time the Phase transitioned.
LastPhaseTransitionTime *metav1.Time `json:"lastPhaseTransitionTime,omitempty"`
// NetworkHandle is the handle of the network the NetworkInterface is in.
NetworkHandle string `json:"networkHandle,omitempty"`
// IPs are the ips allocated for the network interface.
IPs []commonv1alpha1.IP `json:"ips,omitempty"`
// VirtualIP is the virtual ip allocated for the network interface.
VirtualIP *commonv1alpha1.IP `json:"virtualIP,omitempty"`
// State represents the attachment state of a NetworkInterface.
State NetworkInterfaceState `json:"state,omitempty"`
// LastStateTransitionTime is the last time the State transitioned.
LastStateTransitionTime *metav1.Time `json:"lastStateTransitionTime,omitempty"`
// Phase is the NetworkInterface binding phase of the NetworkInterface.
Phase NetworkInterfacePhase `json:"phase,omitempty"`
// LastPhaseTransitionTime is the last time the Phase transitioned.
LastPhaseTransitionTime *metav1.Time `json:"lastPhaseTransitionTime,omitempty"`
}

// NetworkInterfaceState is the infrastructure attachment state a NetworkInterface can be in.
type NetworkInterfaceState string

const (
// NetworkInterfaceStatePending indicates that the attachment of a network interface is pending.
NetworkInterfaceStatePending NetworkInterfaceState = "Pending"
// NetworkInterfaceStateAttached indicates that a network interface has been successfully attached.
NetworkInterfaceStateAttached NetworkInterfaceState = "Attached"
// NetworkInterfaceStateError indicates that there was an error during attaching a network interface.
NetworkInterfaceStateError NetworkInterfaceState = "Error"
// NetworkInterfaceStateDetached indicates that a network interface has been successfully detached.
NetworkInterfaceStateDetached NetworkInterfaceState = "Detached"
)

// NetworkInterfacePhase represents the binding phase a NetworkInterface can be in.
type NetworkInterfacePhase string

Expand All @@ -136,18 +156,58 @@ const (
NetworkInterfacePhaseBound NetworkInterfacePhase = "Bound"
)

// EmptyDiskVolumeStatus is the status of an EmptyDiskVolumeSource Volume.
type EmptyDiskVolumeStatus struct {
// Size is the current size of the volume, if any discrete size is available.
Size *resource.Quantity `json:"size,omitempty"`
}

type ReferencedVolumeStatus struct {
// Driver is the driver used for the volume.
Driver string `json:"driver,omitempty"`
// Handle is the unique provider handle of the volume.
Handle string `json:"handle,omitempty"`
}

type VolumeSourceStatus struct {
// EmptyDisk indicates the empty disk status of the volume if it's from an empty disk source.
EmptyDisk *EmptyDiskVolumeStatus `json:"emptyDisk,omitempty"`
// Referenced is the status of a referenced volume (either VolumeSource.Ephemeral or VolumeSource.VolumeRef).
Referenced *ReferencedVolumeStatus `json:"referenced,omitempty"`
}

// VolumeStatus is the status of a Volume.
type VolumeStatus struct {
// Name is the name of a volume attachment.
Name string `json:"name"`
// Device is the device the volume is mounted with on the host.
Device string `json:"device,omitempty"`
// VolumeSourceStatus is the status of the configuration of the volume specified as source.
VolumeSourceStatus `json:",inline,omitempty"`
// State represents the attachment state of a Volume.
State VolumeState `json:"state,omitempty"`
// LastStateTransitionTime is the last time the State transitioned.
LastStateTransitionTime *metav1.Time `json:"lastStateTransitionTime,omitempty"`
// Phase represents the binding phase of a Volume.
Phase VolumePhase `json:"phase,omitempty"`
// LastPhaseTransitionTime is the last time the Phase transitioned.
LastPhaseTransitionTime *metav1.Time `json:"lastPhaseTransitionTime,omitempty"`
// DeviceID is the disk device ID on the host.
DeviceID string `json:"deviceID,omitempty"`
}

// VolumeState is the infrastructure attachment state a Volume can be in.
type VolumeState string

const (
// VolumeStatePending indicates that the attachment of a volume is pending.
VolumeStatePending VolumeState = "Pending"
// VolumeStateAttached indicates that a volume has been successfully attached.
VolumeStateAttached VolumeState = "Attached"
// VolumeStateError indicates that there was an error during attaching a volume.
VolumeStateError VolumeState = "Error"
// VolumeStateDetached indicates that a volume has been successfully detached.
VolumeStateDetached VolumeState = "Detached"
)

// VolumePhase represents the binding phase a Volume can be in.
type VolumePhase string

Expand Down
Loading