forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
instancetype: Support default instance type PVC annotations
This change introduces support for inferring the default instance type and instance type kind from a specific Volume using the recently introduced `inferFromVolume` InstancetypeMatcher attribute. The following combinations are supported by this change: Volume -> PersistentVolumeClaimVolumeSource -> PersistentVolumeClaim Volume -> DataVolumeSource -> DataVolumeSourcePVC -> PersistentVolumeClaim Volume -> DataVolumeSource -> DataVolumeSourceRef -> DataSource -> PersistentVolumeClaim Volume -> DataVolumeSource -> DataVolumeTemplates -> DataVolumeSourcePVC -> PersistentVolumeClaim Volume -> DataVolumeSource -> DataVolumeTemplates -> DataVolumeSourceRef -> DataSource -> PersistentVolumeClaim When a valid Volume name is provided the VirtualMachine mutation webhook will now attempt to find an underlying PersistentVolumeClaim for the Volume, checking for the following annotations: * instancetype.kubevirt.io/default-instancetype This is required when a Volume name has been provided by inferFromVolume, failure to find this on the underlying PersistentVolumeClaim will cause the request to be rejected. This simply provides the name of the default instance type. * instancetype.kubevirt.io/default-instancetype-kind This is optional, when not provided the existing default of VirtualMachineClusterInstancetype will be applied. The InstancetypeMatcher of the VirtualMachine is recreated using these values before the request is passed to the validation webhook where the existing InstancetypeMatcher checks for conflicts etc are processed. Signed-off-by: Lee Yarwood <[email protected]>
- Loading branch information
Showing
7 changed files
with
599 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.