Skip to content

Commit

Permalink
Adds new field for min hardware version
Browse files Browse the repository at this point in the history
Adds a new field to set the minimum hardware version on the
VSphereMachine Spec. This field is used to a similar field in the
VMOperator's VirtualMachineSpec.

Signed-off-by: Sagar Muchhal <[email protected]>
  • Loading branch information
srm09 committed Nov 15, 2023
1 parent ea2041d commit 7df1bd6
Show file tree
Hide file tree
Showing 15 changed files with 166 additions and 212 deletions.
10 changes: 9 additions & 1 deletion apis/vmware/v1beta1/vspheremachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type VSphereMachineVolume struct {

// VSphereMachineSpec defines the desired state of VSphereMachine.
type VSphereMachineSpec struct {
// ProviderID is the virtual machine's BIOS UUID formated as
// ProviderID is the virtual machine's BIOS UUID formatted as
// vsphere://12345678-1234-1234-1234-123456789abc.
// This is required at runtime by CAPI. Do not remove this field.
// +optional
Expand Down Expand Up @@ -79,6 +79,14 @@ type VSphereMachineSpec struct {
// +optional
// +kubebuilder:default=hard
PowerOffMode VirtualMachinePowerOpMode `json:"powerOffMode,omitempty"`

// MinHardwareVersion specifies the desired minimum hardware version
// for this VM. Setting this field will ensure that the hardware version
// of the VM is at least set to the specified value.
// The expected format of the field is vmx-15.
//
// +optional
MinHardwareVersion string `json:"minHardwareVersion,omitempty"`
}

// VSphereMachineStatus defines the observed state of VSphereMachine.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@ spec:
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.providerRef.name
name: Provider-Name
type: string
- jsonPath: .status.contentLibraryRef.name
name: Content-Library-Name
type: string
- jsonPath: .status.imageName
name: Image-Name
name: Display-Name
type: string
- jsonPath: .spec.productInfo.version
name: Version
Expand Down Expand Up @@ -256,7 +250,7 @@ spec:
eg: bios, efi.'
type: string
imageName:
description: ImageName describes the display name of this VirtualMachineImage.
description: ImageName describes the display name of this image.
type: string
imageSupported:
description: 'ImageSupported indicates whether the VirtualMachineImage
Expand All @@ -275,12 +269,12 @@ spec:
type: object
type: object
served: true
storage: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .status.name
name: Image Name
name: Display Name
type: string
- jsonPath: .status.productInfo.version
name: Image Version
Expand Down Expand Up @@ -439,8 +433,7 @@ spec:
format: int32
type: integer
name:
description: Name describes the observed, "friendly" name for this
image.
description: Name describes the display name of this image.
type: string
osInfo:
description: "OSInfo describes the observed operating system information
Expand Down Expand Up @@ -509,9 +502,15 @@ spec:
of this image is a Content Library, this will be the version of
the corresponding Content Library item.
type: string
providerItemID:
description: ProviderItemID describes the ID of the provider item
that this image corresponds to. If the provider of this image is
a Content Library, this ID will be that of the corresponding Content
Library item.
type: string
type: object
type: object
served: true
storage: false
storage: true
subresources:
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ spec:
type: object
type: object
served: true
storage: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
Expand Down Expand Up @@ -498,6 +498,6 @@ spec:
type: object
type: object
served: true
storage: false
storage: true
subresources:
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@ spec:
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.providerRef.name
name: Provider-Name
type: string
- jsonPath: .status.contentLibraryRef.name
name: Content-Library-Name
type: string
- jsonPath: .status.imageName
name: Image-Name
name: Display-Name
type: string
- jsonPath: .spec.productInfo.version
name: Version
Expand Down Expand Up @@ -256,7 +250,7 @@ spec:
eg: bios, efi.'
type: string
imageName:
description: ImageName describes the display name of this VirtualMachineImage.
description: ImageName describes the display name of this image.
type: string
imageSupported:
description: 'ImageSupported indicates whether the VirtualMachineImage
Expand All @@ -275,12 +269,12 @@ spec:
type: object
type: object
served: true
storage: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .status.name
name: Image Name
name: Display Name
type: string
- jsonPath: .status.productInfo.version
name: Image Version
Expand Down Expand Up @@ -442,8 +436,7 @@ spec:
format: int32
type: integer
name:
description: Name describes the observed, "friendly" name for this
image.
description: Name describes the display name of this image.
type: string
osInfo:
description: "OSInfo describes the observed operating system information
Expand Down Expand Up @@ -512,9 +505,15 @@ spec:
of this image is a Content Library, this will be the version of
the corresponding Content Library item.
type: string
providerItemID:
description: ProviderItemID describes the ID of the provider item
that this image corresponds to. If the provider of this image is
a Content Library, this ID will be that of the corresponding Content
Library item.
type: string
type: object
type: object
served: true
storage: false
storage: true
subresources:
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ spec:
published object.
type: string
name:
description: "Name is the name of the published object. \n
If the spec.target.location.apiVersion equals imageregistry.vmware.com/v1alpha1
description: "Name is the display name of the published object.
\n If the spec.target.location.apiVersion equals imageregistry.vmware.com/v1alpha1
and the spec.target.location.kind equals ContentLibrary,
then this should be the name that will show up in vCenter
Content Library, not the custom resource name in the namespace.
Expand Down Expand Up @@ -256,8 +256,8 @@ spec:
published object.
type: string
name:
description: "Name is the name of the published object. \n
If the spec.target.location.apiVersion equals imageregistry.vmware.com/v1alpha1
description: "Name is the display name of the published object.
\n If the spec.target.location.apiVersion equals imageregistry.vmware.com/v1alpha1
and the spec.target.location.kind equals ContentLibrary,
then this should be the name that will show up in vCenter
Content Library, not the custom resource name in the namespace.
Expand Down Expand Up @@ -291,7 +291,7 @@ spec:
type: object
type: object
served: true
storage: true
storage: false
subresources:
status: {}
- name: v1alpha2
Expand Down Expand Up @@ -594,6 +594,6 @@ spec:
type: object
type: object
served: true
storage: false
storage: true
subresources:
status: {}
Loading

0 comments on commit 7df1bd6

Please sign in to comment.