Skip to content

Commit

Permalink
Removes the v1alpha2 VMOp CRDs
Browse files Browse the repository at this point in the history
VMOp recently introduced the v1a2 CRDs and flipped the default storage
version flag on the new CRDs to true and set the storage version on the
v1a1 CRDs as false. Bringing in the latest version of VMOp API, causes
the generated VMOp CRDs in CAPV to have the same change.
The VMOp APIs between v1a1 and v1a2 have changed considerably, and it is
the responsibility of VMOp's conversion webhooks to make sure that the
functionality remains the same even when the storage version for v1a2 is
flipped to true.

Currently CAPV explcitly uses the VMOp v1a1 CRDs as the base for
creating the custom resources. As part of the integration tests for the
supervisor API types, CAPV runs a set of integration tests on the ind
cluster. No conversion webhooks are operational in this test setup.
Hence, we cannot rely on the auto conversion of CRs across versions via
the VMOp webhooks. For this reason, we are explictly generating the
v1alpha1 CRDs only and using those in the integration tests.

Signed-off-by: Sagar Muchhal <[email protected]>
  • Loading branch information
srm09 committed Nov 15, 2023
1 parent 6cca077 commit 7bfad9d
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 3,399 deletions.
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
Original file line number Diff line number Diff line change
Expand Up @@ -269,248 +269,6 @@ spec:
type: object
type: object
served: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .status.name
name: Display 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 display name of 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
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: true
subresources:
status: {}
Loading

0 comments on commit 7bfad9d

Please sign in to comment.