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

✨ Adds new field to set the minimum hardware version #2509

Merged
merged 2 commits into from
Nov 17, 2023
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
output:crd:dir=$(SUPERVISOR_CRD_ROOT)
# vm-operator crds are loaded to be used for integration tests.
$(CONTROLLER_GEN) \
paths=github.com/vmware-tanzu/vm-operator/api/... \
paths=github.com/vmware-tanzu/vm-operator/api/v1alpha1/... \
crd:crdVersions=v1 \
output:crd:dir=$(VMOP_CRD_ROOT)

Expand Down
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 @@ -278,240 +272,3 @@ spec:
storage: true
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .status.name
name: Image Name
type: string
- jsonPath: .status.productInfo.version
name: Image Version
type: string
- jsonPath: .status.osInfo.type
name: OS Name
type: string
- jsonPath: .status.osInfo.version
name: OS Version
type: string
- jsonPath: .status.hardwareVersion
name: Hardware Version
type: string
name: v1alpha2
schema:
openAPIV3Schema:
description: ClusterVirtualMachineImage is the schema for the clustervirtualmachineimages
API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: VirtualMachineImageSpec defines the desired state of VirtualMachineImage.
properties:
providerRef:
description: ProviderRef is a reference to the resource that contains
the source of this image's information.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this
representation of an object. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource
this object represents. Servers may infer this from the endpoint
the client submits requests to. Cannot be updated. In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name refers to a unique resource in the current
namespace. More info: http://kubernetes.io/docs/user-guide/identifiers#names'
type: string
required:
- apiVersion
- kind
- name
type: object
type: object
status:
description: VirtualMachineImageStatus defines the observed state of VirtualMachineImage.
properties:
capabilities:
description: "Capabilities describes the image's observed capabilities.
\n The capabilities are discerned when VM Operator reconciles an
image. If the source of an image is an OVF in Content Library, then
the capabilities are parsed from the OVF property capabilities.image.vmoperator.vmware.com
as a comma-separated list of values. Well-known capabilities include:
\n * cloud-init * nvidia-gpu * sriov-net \n Every capability is
also added to the resource's labels as VirtualMachineImageCapabilityLabel
+ Value. For example, if the capability is \"cloud-init\" then the
following label will be added to the resource: capability.image.vmoperator.vmware.com/cloud-init."
items:
type: string
type: array
x-kubernetes-list-type: set
conditions:
description: Conditions describes the observed conditions for this
image.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource. --- This struct is intended for direct
use as an array at the field path .status.conditions. For example,
\n type FooStatus struct{ // Represents the observations of a
foo's current state. // Known .status.conditions.type are: \"Available\",
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
// +listType=map // +listMapKey=type Conditions []metav1.Condition
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition
transitioned from one status to another. This should be when
the underlying condition changed. If that is not known, then
using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating
details about the transition. This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation
that the condition was set based upon. For instance, if .metadata.generation
is currently 12, but the .status.conditions[x].observedGeneration
is 9, the condition is out of date with respect to the current
state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating
the reason for the condition's last transition. Producers
of specific condition types may define expected values and
meanings for this field, and whether the values are considered
a guaranteed API. The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
--- Many .condition.type values are consistent across resources
like Available, but because arbitrary conditions can be useful
(see .node.status.conditions), the ability to deconflict is
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
firmware:
description: Firmware describe the firmware type used by this image,
ex. BIOS, EFI.
type: string
hardwareVersion:
description: HardwareVersion describes the observed hardware version
of this image.
format: int32
type: integer
name:
description: Name describes the observed, "friendly" name for this
image.
type: string
osInfo:
description: "OSInfo describes the observed operating system information
for this image. \n The OS information is also added to the image
resource's labels. Please refer to VirtualMachineImageOSInfo for
more information."
properties:
id:
description: "ID describes the operating system ID. \n This value
is also added to the image resource's labels as VirtualMachineImageOSIDLabel."
type: string
type:
description: "Type describes the operating system type. \n This
value is also added to the image resource's labels as VirtualMachineImageOSTypeLabel."
type: string
version:
description: "Version describes the operating system version.
\n This value is also added to the image resource's labels as
VirtualMachineImageOSVersionLabel."
type: string
type: object
ovfProperties:
description: OVFProperties describes the observed OVF properties defined
for this image.
items:
description: OVFProperty describes an OVF property associated with
an image. OVF properties may be used in conjunction with the vAppConfig
bootstrap provider to customize a VM during its creation.
properties:
default:
description: Default describes the OVF property's default value.
type: string
key:
description: Key describes the OVF property's key.
type: string
type:
description: Type describes the OVF property's type.
type: string
required:
- key
- type
type: object
type: array
productInfo:
description: ProductInfo describes the observed product information
for this image.
properties:
fullVersion:
description: FullVersion describes the long-form version of the
image.
type: string
product:
description: Product is a general descriptor for the image.
type: string
vendor:
description: Vendor describes the organization/user that produced
the image.
type: string
version:
description: Version describes the short-form version of the image.
type: string
type: object
providerContentVersion:
description: ProviderContentVersion describes the content version
from the provider item that this image corresponds to. If the provider
of this image is a Content Library, this will be the version of
the corresponding Content Library item.
type: string
type: object
type: object
served: true
storage: false
subresources:
status: {}
Loading
Loading