From a029ed1f8584195f8de704d91af0a5acd4b7a315 Mon Sep 17 00:00:00 2001 From: akutz Date: Mon, 15 Apr 2024 11:56:03 -0500 Subject: [PATCH] v1alpha3 This patch introduces schema version v1alpha3. This patch only includes plumbing changes for the API definitions, which, at this time, are a one-for-one copy of v1alpha2. This change allows developers to make updates to the API on main without impacting v1alpha2, which is locked. --- .golangci.yml | 4 + Makefile | 2 +- api/v1alpha1/conversion_test.go | 10 +- api/v1alpha1/doc.go | 4 +- api/v1alpha1/virtualmachine_conversion.go | 382 +- .../virtualmachine_conversion_test.go | 18 +- .../virtualmachineclass_conversion.go | 24 +- .../virtualmachineimage_conversion.go | 186 +- .../virtualmachineimage_conversion_test.go | 6 +- ...virtualmachinepublishrequest_conversion.go | 18 +- .../virtualmachineservice_conversion.go | 18 +- ...tualmachinesetresourcepolicy_conversion.go | 30 +- api/v1alpha1/zz_generated.conversion.go | 1456 ++++---- api/v1alpha1/zz_generated.deepcopy.go | 2 +- .../cloudinit/zz_generated.deepcopy.go | 2 +- api/v1alpha2/common/types.go | 2 +- api/v1alpha2/common/zz_generated.deepcopy.go | 2 +- api/v1alpha2/doc.go | 3 +- api/v1alpha2/groupversion_info.go | 5 +- api/v1alpha2/sysprep/zz_generated.deepcopy.go | 2 +- api/v1alpha2/virtualmachine_conversion.go | 56 +- api/v1alpha2/virtualmachine_network_types.go | 2 +- api/v1alpha2/virtualmachine_types.go | 1 - .../virtualmachineclass_conversion.go | 34 +- api/v1alpha2/virtualmachineclass_types.go | 1 - .../virtualmachineimage_conversion.go | 60 +- api/v1alpha2/virtualmachineimage_types.go | 4 +- ...virtualmachinepublishrequest_conversion.go | 34 +- .../virtualmachinepublishrequest_types.go | 1 - .../virtualmachineservice_conversion.go | 34 +- api/v1alpha2/virtualmachineservice_types.go | 1 - ...tualmachinesetresourcepolicy_conversion.go | 34 +- .../virtualmachinesetresourcepolicy_types.go | 1 - ...tualmachinewebconsolerequest_conversion.go | 34 + .../virtualmachinewebconsolerequest_types.go | 1 - api/v1alpha2/zz_generated.conversion.go | 3300 +++++++++++++++++ api/v1alpha2/zz_generated.deepcopy.go | 18 +- api/v1alpha3/cloudinit/cloudconfig.go | 324 ++ .../cloudinit/zz_generated.deepcopy.go | 197 + api/v1alpha3/common/types.go | 99 + api/v1alpha3/common/zz_generated.deepcopy.go | 127 + api/v1alpha3/condition_consts.go | 9 + api/v1alpha3/doc.go | 7 + api/v1alpha3/groupversion_info.go | 23 + api/v1alpha3/sysprep/sysprep.go | 224 ++ api/v1alpha3/sysprep/zz_generated.deepcopy.go | 191 + api/v1alpha3/testdata/vm-with-cloudinit.yaml | 43 + api/v1alpha3/testdata/vm-with-sysprep.yaml | 40 + .../virtualmachine_bootstrap_types.go | 184 + api/v1alpha3/virtualmachine_conversion.go | 10 + api/v1alpha3/virtualmachine_network_types.go | 651 ++++ .../virtualmachine_readiness_types.go | 127 + api/v1alpha3/virtualmachine_storage_types.go | 88 + api/v1alpha3/virtualmachine_types.go | 583 +++ api/v1alpha3/virtualmachine_webhook.go | 12 + .../virtualmachineclass_conversion.go | 10 + api/v1alpha3/virtualmachineclass_types.go | 206 + api/v1alpha3/virtualmachineclass_webhook.go | 12 + .../virtualmachineimage_conversion.go | 16 + api/v1alpha3/virtualmachineimage_types.go | 296 ++ api/v1alpha3/virtualmachineimage_webhook.go | 18 + ...virtualmachinepublishrequest_conversion.go | 10 + .../virtualmachinepublishrequest_types.go | 373 ++ .../virtualmachinepublishrequest_webhook.go | 12 + .../virtualmachineservice_conversion.go | 10 + api/v1alpha3/virtualmachineservice_types.go | 177 + api/v1alpha3/virtualmachineservice_webhook.go | 12 + ...tualmachinesetresourcepolicy_conversion.go | 10 + .../virtualmachinesetresourcepolicy_types.go | 77 + ...virtualmachinesetresourcepolicy_webhook.go | 12 + api/v1alpha3/virtualmachinetempl_types.go | 50 + ...tualmachinewebconsolerequest_conversion.go | 10 + .../virtualmachinewebconsolerequest_types.go | 85 + ...virtualmachinewebconsolerequest_webhook.go | 12 + api/v1alpha3/zz_generated.deepcopy.go | 2120 +++++++++++ ...mware.com_clustervirtualmachineimages.yaml | 302 ++ ...ator.vmware.com_virtualmachineclasses.yaml | 217 ++ ...rator.vmware.com_virtualmachineimages.yaml | 304 ++ ...are.com_virtualmachinepublishrequests.yaml | 383 ++ ...vmoperator.vmware.com_virtualmachines.yaml | 2399 ++++++++++++ ...tor.vmware.com_virtualmachineservices.yaml | 171 + ...com_virtualmachinesetresourcepolicies.yaml | 108 + ....com_virtualmachinewebconsolerequests.yaml | 94 + config/webhook/manifests.yaml | 42 +- .../clustercontentlibraryitem_controller.go | 24 +- ...contentlibraryitem_controller_intg_test.go | 6 +- ...ontentlibraryitem_controller_suite_test.go | 6 +- ...contentlibraryitem_controller_unit_test.go | 22 +- .../contentlibraryitem_controller.go | 24 +- ...contentlibraryitem_controller_intg_test.go | 6 +- ...ontentlibraryitem_controller_suite_test.go | 6 +- ...contentlibraryitem_controller_unit_test.go | 24 +- controllers/contentlibrary/controllers.go | 10 +- .../{v1alpha2 => }/utils/constants.go | 0 .../{v1alpha2 => }/utils/test_utils.go | 0 .../{v1alpha2 => }/utils/utils.go | 0 .../{v1alpha2 => }/utils/utils_test.go | 4 +- .../contentlibrary/v1alpha2/controllers.go | 25 - .../configmap/infra_configmap_controller.go | 2 +- .../infra_configmap_controller_intg_test.go | 2 +- .../configmap/infra_configmap_suite_test.go | 4 +- .../infra/configmap/infra_configmap_test.go | 2 +- .../infra/node/infra_node_controller.go | 2 +- .../node/infra_node_controller_intg_test.go | 2 +- .../node/infra_node_controller_suite_test.go | 4 +- .../infra/secret/infra_secret_controller.go | 2 +- .../infra_secret_controller_intg_test.go | 2 +- .../infra_secret_controller_suite_test.go | 4 +- controllers/virtualmachine/controllers.go | 16 - .../virtualmachine_controller.go | 22 +- .../virtualmachine_controller_intg_test.go | 8 +- .../virtualmachine_controller_suite_test.go | 8 +- .../virtualmachine_controller_unit_test.go | 18 +- .../virtualmachineclass/controllers.go | 16 - .../virtualmachineclass_controller.go | 10 +- ...irtualmachineclass_controller_intg_test.go | 8 +- ...rtualmachineclass_controller_suite_test.go | 6 +- ...irtualmachineclass_controller_unit_test.go | 14 +- .../controllers.go | 16 - ...virtualmachinepublishrequest_controller.go | 48 +- ...hinepublishrequest_controller_intg_test.go | 12 +- ...inepublishrequest_controller_suite_test.go | 10 +- ...hinepublishrequest_controller_unit_test.go | 20 +- .../virtualmachineservice/controllers.go | 16 - .../providers/loadbalancer_provider.go | 4 +- .../loadbalancer_provider_suite_test.go | 0 .../providers/loadbalancer_provider_test.go | 6 +- .../{v1alpha2 => }/utils/constants.go | 0 .../{v1alpha2 => }/utils/endpoints.go | 50 +- .../virtualmachineservice_controller.go | 32 +- ...tualmachineservice_controller_intg_test.go | 8 +- ...ualmachineservice_controller_suite_test.go | 6 +- ...tualmachineservice_controller_unit_test.go | 24 +- .../controllers.go | 16 - ...tualmachinesetresourcepolicy_controller.go | 20 +- ...esetresourcepolicy_controller_intg_test.go | 8 +- ...setresourcepolicy_controller_suite_test.go | 10 +- ...esetresourcepolicy_controller_unit_test.go | 16 +- .../v1alpha1/conditions/getter.go | 44 +- .../v1alpha1/conditions/getter_test.go | 82 +- .../v1alpha1/conditions/matcher.go | 12 +- .../v1alpha1/conditions/matcher_test.go | 146 +- .../v1alpha1/conditions/merge.go | 22 +- .../v1alpha1/conditions/merge_strategies.go | 16 +- .../conditions/merge_strategies_test.go | 24 +- .../v1alpha1/conditions/merge_test.go | 52 +- .../v1alpha1/conditions/patch.go | 12 +- .../v1alpha1/conditions/patch_test.go | 22 +- .../v1alpha1/conditions/setter.go | 38 +- .../v1alpha1/conditions/setter_test.go | 50 +- .../v1alpha1/conditions/unstructured.go | 8 +- .../v1alpha1/conditions/unstructured_test.go | 12 +- .../v1alpha1/patch/options.go | 6 +- .../v1alpha1/patch/patch.go | 4 +- .../v1alpha1/patch/patch_test.go | 62 +- .../v1alpha1/patch/utils_test.go | 6 +- .../v1alpha1/webconsolerequest_controller.go | 39 +- .../v1alpha1/webconsolerequest_intg_test.go | 30 +- .../v1alpha1/webconsolerequest_suite_test.go | 4 +- .../v1alpha1/webconsolerequest_unit_test.go | 28 +- .../v1alpha2/webconsolerequest_controller.go | 16 +- .../v1alpha2/webconsolerequest_intg_test.go | 4 +- .../v1alpha2/webconsolerequest_suite_test.go | 4 +- .../v1alpha2/webconsolerequest_unit_test.go | 12 +- controllers/volume/controllers.go | 16 - .../{v1alpha2 => }/volume_controller.go | 50 +- .../volume_controller_intg_test.go | 14 +- .../volume_controller_suite_test.go | 10 +- .../volume_controller_unit_test.go | 32 +- docs/start/contrib/submit-change.md | 4 +- hack/boilerplate/boilerplate.generatego.txt | 2 +- pkg/conditions/getter.go | 10 +- pkg/conditions/getter_test.go | 2 +- pkg/conditions/merge_strategies_test.go | 2 +- pkg/conditions/merge_test.go | 2 +- pkg/conditions/patch_test.go | 2 +- pkg/conditions/setter_test.go | 2 +- pkg/conditions/unstructured_test.go | 2 +- pkg/constants/testlabels/test_labels.go | 4 +- .../clustercontentlibraryitem_context.go | 18 +- pkg/context/contentlibraryitem_context.go | 18 +- pkg/context/controller_manager_context.go | 4 +- .../fake/fake_controller_manager_context.go | 2 +- pkg/context/virtualmachine_context.go | 16 +- pkg/context/virtualmachineclass_context.go | 16 +- .../virtualmachinepublishrequest_context.go | 22 +- pkg/context/virtualmachineservice_context.go | 16 +- ...virtualmachinesetresourcepolicy_context.go | 16 +- pkg/context/volume_context.go | 8 +- pkg/context/webconsolerequest_context.go | 8 +- pkg/manager/init/init_providers.go | 4 +- pkg/manager/manager.go | 9 +- pkg/metrics/vmservice_metrics.go | 14 +- pkg/patch/patch_test.go | 2 +- pkg/patch/utils_test.go | 2 +- pkg/prober/context/probe_context.go | 2 +- pkg/prober/fake/fake_prober_manager.go | 2 +- pkg/prober/fake/worker/fake_prober_worker.go | 2 +- pkg/prober/probe/guestinfo_test.go | 2 +- pkg/prober/probe/heartbeat.go | 2 +- pkg/prober/probe/heartbeat_test.go | 2 +- pkg/prober/probe/probe.go | 2 +- pkg/prober/probe/tcp.go | 2 +- pkg/prober/probe/tcp_test.go | 2 +- pkg/prober/prober_manager.go | 6 +- pkg/prober/prober_manager_test.go | 4 +- pkg/prober/worker/prober_worker.go | 2 +- pkg/prober/worker/readiness_worker.go | 2 +- pkg/prober/worker/readiness_worker_test.go | 2 +- pkg/util/cloudinit/cloudconfig.go | 4 +- pkg/util/cloudinit/cloudconfig_secret.go | 4 +- pkg/util/cloudinit/cloudconfig_secret_test.go | 4 +- pkg/util/cloudinit/cloudconfig_test.go | 4 +- pkg/util/cloudinit/validate/validate.go | 4 +- pkg/util/cloudinit/validate/validate_test.go | 4 +- pkg/util/image/status_to_label.go | 2 +- pkg/util/image/status_to_label_test.go | 2 +- ..._vm_provider_a2.go => fake_vm_provider.go} | 72 +- pkg/vmprovider/interface.go | 43 + pkg/vmprovider/interface_a2.go | 43 - .../{vsphere2 => vsphere}/client/client.go | 6 +- .../client/client_suite_test.go | 0 .../client/client_test.go | 6 +- .../clustermodules/cluster_modules.go | 0 .../cluster_modules_provider.go | 0 .../cluster_modules_suite_test.go | 0 .../clustermodules/cluster_modules_test.go | 12 +- .../clustermodules/cluster_modules_utils.go | 2 +- .../cluster_modules_utils_test.go | 4 +- .../{vsphere2 => vsphere}/config/config.go | 2 +- .../config/config_suite_test.go | 0 .../config/config_test.go | 4 +- .../constants/constants.go | 0 .../contentlibrary/content_library.go | 0 .../content_library_provider.go | 0 .../content_library_suite_test.go | 0 .../contentlibrary/content_library_test.go | 2 +- .../contentlibrary/content_library_utils.go | 6 +- .../content_library_utils_test.go | 6 +- .../credentials/credentials.go | 0 .../credentials/credentials_suite_test.go | 0 .../credentials/credentials_test.go | 2 +- .../instancestorage/instance_storage.go | 2 +- .../internal/internal.go | 0 .../{vsphere2 => vsphere}/network/gosc.go | 0 .../network/gosc_test.go | 2 +- .../{vsphere2 => vsphere}/network/netplan.go | 2 +- .../network/netplan_test.go | 4 +- .../{vsphere2 => vsphere}/network/network.go | 100 +- .../network/network_suite_test.go | 0 .../network/network_test.go | 24 +- .../{vsphere2 => vsphere}/network/nsxt.go | 0 .../network/nsxt_test.go | 2 +- .../placement/cluster_placement.go | 6 +- .../placement/cluster_placement_test.go | 6 +- .../placement/placement_suite_test.go | 0 .../placement/zone_placement.go | 18 +- .../placement/zone_placement_test.go | 10 +- .../{vsphere2 => vsphere}/resources/vm.go | 2 +- .../{vsphere2 => vsphere}/session/session.go | 8 +- .../session/session_suite_test.go | 0 .../session/session_vm.go | 2 +- .../session/session_vm_update.go | 42 +- .../session/session_vm_update_test.go | 10 +- .../storage/provisioning.go | 4 +- .../storage/storageclass.go | 6 +- .../{vsphere2 => vsphere}/sysprep/secret.go | 2 +- .../sysprep/secret_test.go | 4 +- .../sysprep/suite_test.go | 0 .../{vsphere2 => vsphere}/vcenter/cluster.go | 0 .../vcenter/cluster_test.go | 2 +- .../{vsphere2 => vsphere}/vcenter/folder.go | 0 .../vcenter/folder_test.go | 2 +- .../{vsphere2 => vsphere}/vcenter/getvm.go | 10 +- .../vcenter/getvm_test.go | 12 +- .../{vsphere2 => vsphere}/vcenter/host.go | 0 .../vcenter/host_test.go | 2 +- .../vcenter/resourcepool.go | 2 +- .../vcenter/resourcepool_test.go | 4 +- .../vcenter/vcenter_suite_test.go | 0 .../virtualmachine/backup.go | 6 +- .../virtualmachine/backup_test.go | 8 +- .../virtualmachine/ccr.go | 0 .../virtualmachine/ccr_test.go | 2 +- .../virtualmachine/configspec.go | 10 +- .../virtualmachine/configspec_test.go | 14 +- .../virtualmachine/conversion.go | 0 .../virtualmachine/conversion_test.go | 2 +- .../virtualmachine/delete.go | 2 +- .../virtualmachine/delete_test.go | 6 +- .../virtualmachine/devices.go | 4 +- .../virtualmachine/guestinfo.go | 0 .../virtualmachine/guestinfo_test.go | 2 +- .../virtualmachine/heartbeat.go | 2 +- .../virtualmachine/publish.go | 4 +- .../virtualmachine/publish_test.go | 8 +- .../virtualmachine/storage.go | 8 +- .../virtualmachine_suite_test.go | 0 .../virtualmachine/webconsole_ticket.go | 2 +- .../virtualmachine/webconsole_ticket_test.go | 2 +- .../vmlifecycle/bootstrap.go | 20 +- .../vmlifecycle/bootstrap_cloudinit.go | 10 +- .../vmlifecycle/bootstrap_cloudinit_test.go | 18 +- .../vmlifecycle/bootstrap_linuxprep.go | 4 +- .../vmlifecycle/bootstrap_linuxprep_test.go | 12 +- .../vmlifecycle/bootstrap_sysprep.go | 6 +- .../vmlifecycle/bootstrap_sysprep_test.go | 16 +- .../vmlifecycle/bootstrap_templatedata.go | 53 +- .../bootstrap_templatedata_test.go | 12 +- .../vmlifecycle/bootstrap_test.go | 4 +- .../vmlifecycle/bootstrap_vappconfig.go | 2 +- .../vmlifecycle/bootstrap_vappconfig_test.go | 6 +- .../vmlifecycle/create.go | 4 +- .../vmlifecycle/create_clone.go | 8 +- .../vmlifecycle/create_contentlibrary.go | 10 +- .../vmlifecycle/update_status.go | 10 +- .../vmlifecycle/update_status_test.go | 10 +- .../vmlifecycle/vmlifecycle_suite_test.go | 0 .../{vsphere2 => vsphere}/vmprovider.go | 16 +- .../vmprovider_resourcepolicy.go | 6 +- .../vmprovider_resourcepolicy_test.go | 6 +- .../{vsphere2 => vsphere}/vmprovider_test.go | 4 +- .../{vsphere2 => vsphere}/vmprovider_vm.go | 87 +- .../vmprovider_vm2_test.go | 16 +- .../vmprovider_vm_test.go | 20 +- .../vmprovider_vm_utils.go | 28 +- .../vmprovider_vm_utils_test.go | 16 +- .../vsphere_suite_test.go | 0 pkg/webconsolevalidation/server.go | 6 +- pkg/webconsolevalidation/server_test.go | 4 +- test/builder/fake.go | 30 +- test/builder/test_suite.go | 3 - test/builder/util.go | 8 +- test/builder/utila2.go | 2 +- test/builder/vcsim_test_context.go | 13 +- webhooks/common/response_test.go | 6 +- .../persistentvolumeclaim_validator.go | 2 +- ...rsistentvolumeclaim_validator_intg_test.go | 6 +- ...rsistentvolumeclaim_validator_unit_test.go | 8 +- .../mutation/virtualmachine_mutator.go | 33 +- .../virtualmachine_mutator_intg_test.go | 4 +- .../virtualmachine_mutator_suite_test.go | 4 +- .../virtualmachine_mutator_unit_test.go | 19 +- webhooks/virtualmachine/v1alpha2/webhooks.go | 23 - .../validation/virtualmachine_validator.go | 18 +- .../virtualmachine_validator_intg_test.go | 10 +- .../virtualmachine_validator_suite_test.go | 4 +- .../virtualmachine_validator_unit_test.go | 22 +- webhooks/virtualmachine/webhooks.go | 10 +- .../mutation/virtualmachineclass_mutator.go | 4 +- .../virtualmachineclass_mutator_intg_test.go | 4 +- .../virtualmachineclass_mutator_suite_test.go | 4 +- .../virtualmachineclass_mutator_unit_test.go | 6 +- .../virtualmachineclass/v1alpha2/webhooks.go | 23 - .../virtualmachineclass_validator.go | 4 +- ...virtualmachineclass_validator_intg_test.go | 6 +- ...irtualmachineclass_validator_suite_test.go | 4 +- ...virtualmachineclass_validator_unit_test.go | 8 +- webhooks/virtualmachineclass/webhooks.go | 10 +- .../v1alpha2/webhooks.go | 19 - .../virtualmachinepublishrequest_validator.go | 11 +- ...chinepublishrequest_validator_intg_test.go | 8 +- ...hinepublishrequest_validator_suite_test.go | 4 +- ...chinepublishrequest_validator_unit_test.go | 12 +- .../virtualmachinepublishrequest/webhooks.go | 6 +- .../mutation/virtualmachineservice_mutator.go | 4 +- ...virtualmachineservice_mutator_intg_test.go | 4 +- ...irtualmachineservice_mutator_suite_test.go | 4 +- ...virtualmachineservice_mutator_unit_test.go | 4 +- .../v1alpha2/webhooks.go | 23 - .../virtualmachineservice_validator.go | 4 +- ...rtualmachineservice_validator_intg_test.go | 8 +- ...tualmachineservice_validator_suite_test.go | 4 +- ...rtualmachineservice_validator_unit_test.go | 10 +- webhooks/virtualmachineservice/webhooks.go | 10 +- .../v1alpha2/webhooks.go | 20 - ...rtualmachinesetresourcepolicy_validator.go | 4 +- ...nesetresourcepolicy_validator_intg_test.go | 8 +- ...esetresourcepolicy_validator_suite_test.go | 4 +- ...nesetresourcepolicy_validator_unit_test.go | 8 +- .../webhooks.go | 6 +- .../validation/webconsolerequest_validator.go | 18 +- .../webconsolerequest_validator_intg_test.go | 4 +- .../webconsolerequest_validator_unit_test.go | 8 +- .../validation/webconsolerequest_validator.go | 4 +- .../webconsolerequest_validator_intg_test.go | 8 +- .../webconsolerequest_validator_suite_test.go | 2 +- .../webconsolerequest_validator_unit_test.go | 8 +- 388 files changed, 16683 insertions(+), 2904 deletions(-) create mode 100644 api/v1alpha2/virtualmachinewebconsolerequest_conversion.go create mode 100644 api/v1alpha2/zz_generated.conversion.go create mode 100644 api/v1alpha3/cloudinit/cloudconfig.go create mode 100644 api/v1alpha3/cloudinit/zz_generated.deepcopy.go create mode 100644 api/v1alpha3/common/types.go create mode 100644 api/v1alpha3/common/zz_generated.deepcopy.go create mode 100644 api/v1alpha3/condition_consts.go create mode 100644 api/v1alpha3/doc.go create mode 100644 api/v1alpha3/groupversion_info.go create mode 100644 api/v1alpha3/sysprep/sysprep.go create mode 100644 api/v1alpha3/sysprep/zz_generated.deepcopy.go create mode 100644 api/v1alpha3/testdata/vm-with-cloudinit.yaml create mode 100644 api/v1alpha3/testdata/vm-with-sysprep.yaml create mode 100644 api/v1alpha3/virtualmachine_bootstrap_types.go create mode 100644 api/v1alpha3/virtualmachine_conversion.go create mode 100644 api/v1alpha3/virtualmachine_network_types.go create mode 100644 api/v1alpha3/virtualmachine_readiness_types.go create mode 100644 api/v1alpha3/virtualmachine_storage_types.go create mode 100644 api/v1alpha3/virtualmachine_types.go create mode 100644 api/v1alpha3/virtualmachine_webhook.go create mode 100644 api/v1alpha3/virtualmachineclass_conversion.go create mode 100644 api/v1alpha3/virtualmachineclass_types.go create mode 100644 api/v1alpha3/virtualmachineclass_webhook.go create mode 100644 api/v1alpha3/virtualmachineimage_conversion.go create mode 100644 api/v1alpha3/virtualmachineimage_types.go create mode 100644 api/v1alpha3/virtualmachineimage_webhook.go create mode 100644 api/v1alpha3/virtualmachinepublishrequest_conversion.go create mode 100644 api/v1alpha3/virtualmachinepublishrequest_types.go create mode 100644 api/v1alpha3/virtualmachinepublishrequest_webhook.go create mode 100644 api/v1alpha3/virtualmachineservice_conversion.go create mode 100644 api/v1alpha3/virtualmachineservice_types.go create mode 100644 api/v1alpha3/virtualmachineservice_webhook.go create mode 100644 api/v1alpha3/virtualmachinesetresourcepolicy_conversion.go create mode 100644 api/v1alpha3/virtualmachinesetresourcepolicy_types.go create mode 100644 api/v1alpha3/virtualmachinesetresourcepolicy_webhook.go create mode 100644 api/v1alpha3/virtualmachinetempl_types.go create mode 100644 api/v1alpha3/virtualmachinewebconsolerequest_conversion.go create mode 100644 api/v1alpha3/virtualmachinewebconsolerequest_types.go create mode 100644 api/v1alpha3/virtualmachinewebconsolerequest_webhook.go create mode 100644 api/v1alpha3/zz_generated.deepcopy.go rename controllers/contentlibrary/{v1alpha2 => }/clustercontentlibraryitem/clustercontentlibraryitem_controller.go (95%) rename controllers/contentlibrary/{v1alpha2 => }/clustercontentlibraryitem/clustercontentlibraryitem_controller_intg_test.go (98%) rename controllers/contentlibrary/{v1alpha2 => }/clustercontentlibraryitem/clustercontentlibraryitem_controller_suite_test.go (88%) rename controllers/contentlibrary/{v1alpha2 => }/clustercontentlibraryitem/clustercontentlibraryitem_controller_unit_test.go (95%) rename controllers/contentlibrary/{v1alpha2 => }/contentlibraryitem/contentlibraryitem_controller.go (95%) rename controllers/contentlibrary/{v1alpha2 => }/contentlibraryitem/contentlibraryitem_controller_intg_test.go (98%) rename controllers/contentlibrary/{v1alpha2 => }/contentlibraryitem/contentlibraryitem_controller_suite_test.go (88%) rename controllers/contentlibrary/{v1alpha2 => }/contentlibraryitem/contentlibraryitem_controller_unit_test.go (94%) rename controllers/contentlibrary/{v1alpha2 => }/utils/constants.go (100%) rename controllers/contentlibrary/{v1alpha2 => }/utils/test_utils.go (100%) rename controllers/contentlibrary/{v1alpha2 => }/utils/utils.go (100%) rename controllers/contentlibrary/{v1alpha2 => }/utils/utils_test.go (96%) delete mode 100644 controllers/contentlibrary/v1alpha2/controllers.go delete mode 100644 controllers/virtualmachine/controllers.go rename controllers/virtualmachine/{v1alpha2 => }/virtualmachine_controller.go (96%) rename controllers/virtualmachine/{v1alpha2 => }/virtualmachine_controller_intg_test.go (97%) rename controllers/virtualmachine/{v1alpha2 => }/virtualmachine_controller_suite_test.go (80%) rename controllers/virtualmachine/{v1alpha2 => }/virtualmachine_controller_unit_test.go (93%) delete mode 100644 controllers/virtualmachineclass/controllers.go rename controllers/virtualmachineclass/{v1alpha2 => }/virtualmachineclass_controller.go (93%) rename controllers/virtualmachineclass/{v1alpha2 => }/virtualmachineclass_controller_intg_test.go (90%) rename controllers/virtualmachineclass/{v1alpha2 => }/virtualmachineclass_controller_suite_test.go (78%) rename controllers/virtualmachineclass/{v1alpha2 => }/virtualmachineclass_controller_unit_test.go (78%) delete mode 100644 controllers/virtualmachinepublishrequest/controllers.go rename controllers/virtualmachinepublishrequest/{v1alpha2 => }/virtualmachinepublishrequest_controller.go (96%) rename controllers/virtualmachinepublishrequest/{v1alpha2 => }/virtualmachinepublishrequest_controller_intg_test.go (96%) rename controllers/virtualmachinepublishrequest/{v1alpha2 => }/virtualmachinepublishrequest_controller_suite_test.go (74%) rename controllers/virtualmachinepublishrequest/{v1alpha2 => }/virtualmachinepublishrequest_controller_unit_test.go (97%) delete mode 100644 controllers/virtualmachineservice/controllers.go rename controllers/virtualmachineservice/{v1alpha2 => }/providers/loadbalancer_provider.go (98%) rename controllers/virtualmachineservice/{v1alpha2 => }/providers/loadbalancer_provider_suite_test.go (100%) rename controllers/virtualmachineservice/{v1alpha2 => }/providers/loadbalancer_provider_test.go (98%) rename controllers/virtualmachineservice/{v1alpha2 => }/utils/constants.go (100%) rename controllers/virtualmachineservice/{v1alpha2 => }/utils/endpoints.go (82%) rename controllers/virtualmachineservice/{v1alpha2 => }/virtualmachineservice_controller.go (96%) rename controllers/virtualmachineservice/{v1alpha2 => }/virtualmachineservice_controller_intg_test.go (98%) rename controllers/virtualmachineservice/{v1alpha2 => }/virtualmachineservice_controller_suite_test.go (77%) rename controllers/virtualmachineservice/{v1alpha2 => }/virtualmachineservice_controller_unit_test.go (98%) delete mode 100644 controllers/virtualmachinesetresourcepolicy/controllers.go rename controllers/virtualmachinesetresourcepolicy/{v1alpha2 => }/virtualmachinesetresourcepolicy_controller.go (91%) rename controllers/virtualmachinesetresourcepolicy/{v1alpha2 => }/virtualmachinesetresourcepolicy_controller_intg_test.go (93%) rename controllers/virtualmachinesetresourcepolicy/{v1alpha2 => }/virtualmachinesetresourcepolicy_controller_suite_test.go (74%) rename controllers/virtualmachinesetresourcepolicy/{v1alpha2 => }/virtualmachinesetresourcepolicy_controller_unit_test.go (92%) delete mode 100644 controllers/volume/controllers.go rename controllers/volume/{v1alpha2 => }/volume_controller.go (96%) rename controllers/volume/{v1alpha2 => }/volume_controller_intg_test.go (98%) rename controllers/volume/{v1alpha2 => }/volume_controller_suite_test.go (76%) rename controllers/volume/{v1alpha2 => }/volume_controller_unit_test.go (97%) rename pkg/vmprovider/fake/{fake_vm_provider_a2.go => fake_vm_provider.go} (72%) create mode 100644 pkg/vmprovider/interface.go delete mode 100644 pkg/vmprovider/interface_a2.go rename pkg/vmprovider/providers/{vsphere2 => vsphere}/client/client.go (96%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/client/client_suite_test.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/client/client_test.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/clustermodules/cluster_modules.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/clustermodules/cluster_modules_provider.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/clustermodules/cluster_modules_suite_test.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/clustermodules/cluster_modules_test.go (91%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/clustermodules/cluster_modules_utils.go (96%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/clustermodules/cluster_modules_utils_test.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/config/config.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/config/config_suite_test.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/config/config_test.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/constants/constants.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/contentlibrary/content_library.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/contentlibrary/content_library_provider.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/contentlibrary/content_library_suite_test.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/contentlibrary/content_library_test.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/contentlibrary/content_library_utils.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/contentlibrary/content_library_utils_test.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/credentials/credentials.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/credentials/credentials_suite_test.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/credentials/credentials_test.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/instancestorage/instance_storage.go (94%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/internal/internal.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/network/gosc.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/network/gosc_test.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/network/netplan.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/network/netplan_test.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/network/network.go (92%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/network/network_suite_test.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/network/network_test.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/network/nsxt.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/network/nsxt_test.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/placement/cluster_placement.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/placement/cluster_placement_test.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/placement/placement_suite_test.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/placement/zone_placement.go (96%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/placement/zone_placement_test.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/resources/vm.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/session/session.go (90%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/session/session_suite_test.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/session/session_vm.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/session/session_vm_update.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/session/session_vm_update_test.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/storage/provisioning.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/storage/storageclass.go (93%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/sysprep/secret.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/sysprep/secret_test.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/sysprep/suite_test.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vcenter/cluster.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vcenter/cluster_test.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vcenter/folder.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vcenter/folder_test.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vcenter/getvm.go (95%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vcenter/getvm_test.go (94%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vcenter/host.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vcenter/host_test.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vcenter/resourcepool.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vcenter/resourcepool_test.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vcenter/vcenter_suite_test.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/backup.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/backup_test.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/ccr.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/ccr_test.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/configspec.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/configspec_test.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/conversion.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/conversion_test.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/delete.go (96%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/delete_test.go (94%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/devices.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/guestinfo.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/guestinfo_test.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/heartbeat.go (90%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/publish.go (94%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/publish_test.go (94%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/storage.go (91%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/virtualmachine_suite_test.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/webconsole_ticket.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/virtualmachine/webconsole_ticket_test.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/bootstrap.go (96%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/bootstrap_cloudinit.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/bootstrap_cloudinit_test.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/bootstrap_linuxprep.go (95%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/bootstrap_linuxprep_test.go (94%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/bootstrap_sysprep.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/bootstrap_sysprep_test.go (95%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/bootstrap_templatedata.go (90%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/bootstrap_templatedata_test.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/bootstrap_test.go (96%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/bootstrap_vappconfig.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/bootstrap_vappconfig_test.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/create.go (94%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/create_clone.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/create_contentlibrary.go (94%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/update_status.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/update_status_test.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmlifecycle/vmlifecycle_suite_test.go (100%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmprovider.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmprovider_resourcepolicy.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmprovider_resourcepolicy_test.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmprovider_test.go (96%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmprovider_vm.go (95%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmprovider_vm2_test.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmprovider_vm_test.go (99%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmprovider_vm_utils.go (97%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vmprovider_vm_utils_test.go (98%) rename pkg/vmprovider/providers/{vsphere2 => vsphere}/vsphere_suite_test.go (100%) rename webhooks/virtualmachine/{v1alpha2 => }/mutation/virtualmachine_mutator.go (91%) rename webhooks/virtualmachine/{v1alpha2 => }/mutation/virtualmachine_mutator_intg_test.go (99%) rename webhooks/virtualmachine/{v1alpha2 => }/mutation/virtualmachine_mutator_suite_test.go (88%) rename webhooks/virtualmachine/{v1alpha2 => }/mutation/virtualmachine_mutator_unit_test.go (96%) delete mode 100644 webhooks/virtualmachine/v1alpha2/webhooks.go rename webhooks/virtualmachine/{v1alpha2 => }/validation/virtualmachine_validator.go (98%) rename webhooks/virtualmachine/{v1alpha2 => }/validation/virtualmachine_validator_intg_test.go (97%) rename webhooks/virtualmachine/{v1alpha2 => }/validation/virtualmachine_validator_suite_test.go (82%) rename webhooks/virtualmachine/{v1alpha2 => }/validation/virtualmachine_validator_unit_test.go (99%) rename webhooks/virtualmachineclass/{v1alpha2 => }/mutation/virtualmachineclass_mutator.go (92%) rename webhooks/virtualmachineclass/{v1alpha2 => }/mutation/virtualmachineclass_mutator_intg_test.go (94%) rename webhooks/virtualmachineclass/{v1alpha2 => }/mutation/virtualmachineclass_mutator_suite_test.go (89%) rename webhooks/virtualmachineclass/{v1alpha2 => }/mutation/virtualmachineclass_mutator_unit_test.go (96%) delete mode 100644 webhooks/virtualmachineclass/v1alpha2/webhooks.go rename webhooks/virtualmachineclass/{v1alpha2 => }/validation/virtualmachineclass_validator.go (94%) rename webhooks/virtualmachineclass/{v1alpha2 => }/validation/virtualmachineclass_validator_intg_test.go (96%) rename webhooks/virtualmachineclass/{v1alpha2 => }/validation/virtualmachineclass_validator_suite_test.go (89%) rename webhooks/virtualmachineclass/{v1alpha2 => }/validation/virtualmachineclass_validator_unit_test.go (98%) delete mode 100644 webhooks/virtualmachinepublishrequest/v1alpha2/webhooks.go rename webhooks/virtualmachinepublishrequest/{v1alpha2 => }/validation/virtualmachinepublishrequest_validator.go (92%) rename webhooks/virtualmachinepublishrequest/{v1alpha2 => }/validation/virtualmachinepublishrequest_validator_intg_test.go (95%) rename webhooks/virtualmachinepublishrequest/{v1alpha2 => }/validation/virtualmachinepublishrequest_validator_suite_test.go (88%) rename webhooks/virtualmachinepublishrequest/{v1alpha2 => }/validation/virtualmachinepublishrequest_validator_unit_test.go (97%) rename webhooks/virtualmachineservice/{v1alpha2 => }/mutation/virtualmachineservice_mutator.go (91%) rename webhooks/virtualmachineservice/{v1alpha2 => }/mutation/virtualmachineservice_mutator_intg_test.go (94%) rename webhooks/virtualmachineservice/{v1alpha2 => }/mutation/virtualmachineservice_mutator_suite_test.go (89%) rename webhooks/virtualmachineservice/{v1alpha2 => }/mutation/virtualmachineservice_mutator_unit_test.go (95%) delete mode 100644 webhooks/virtualmachineservice/v1alpha2/webhooks.go rename webhooks/virtualmachineservice/{v1alpha2 => }/validation/virtualmachineservice_validator.go (97%) rename webhooks/virtualmachineservice/{v1alpha2 => }/validation/virtualmachineservice_validator_intg_test.go (95%) rename webhooks/virtualmachineservice/{v1alpha2 => }/validation/virtualmachineservice_validator_suite_test.go (89%) rename webhooks/virtualmachineservice/{v1alpha2 => }/validation/virtualmachineservice_validator_unit_test.go (98%) delete mode 100644 webhooks/virtualmachinesetresourcepolicy/v1alpha2/webhooks.go rename webhooks/virtualmachinesetresourcepolicy/{v1alpha2 => }/validation/virtualmachinesetresourcepolicy_validator.go (96%) rename webhooks/virtualmachinesetresourcepolicy/{v1alpha2 => }/validation/virtualmachinesetresourcepolicy_validator_intg_test.go (96%) rename webhooks/virtualmachinesetresourcepolicy/{v1alpha2 => }/validation/virtualmachinesetresourcepolicy_validator_suite_test.go (88%) rename webhooks/virtualmachinesetresourcepolicy/{v1alpha2 => }/validation/virtualmachinesetresourcepolicy_validator_unit_test.go (98%) diff --git a/.golangci.yml b/.golangci.yml index 5a663ebaf..8087292d6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -19,6 +19,10 @@ linters-settings: - pkg: k8s.io/api/core/v1 alias: corev1 - pkg: github.com/vmware-tanzu/vm-operator/api/v1alpha1 + alias: vmopv1a1 + - pkg: github.com/vmware-tanzu/vm-operator/api/v1alpha2 + alias: vmopv1a2 + - pkg: github.com/vmware-tanzu/vm-operator/api/v1alpha3 alias: vmopv1 - pkg: "github.com/vmware-tanzu/vm-operator/pkg/config" alias: pkgconfig diff --git a/Makefile b/Makefile index f44486401..c01bbf4aa 100644 --- a/Makefile +++ b/Makefile @@ -328,7 +328,7 @@ endif generate-go-conversions: $(CONVERSION_GEN) \ - --input-dirs=./api/v1alpha1 \ + --input-dirs='./api/v1alpha1,./api/v1alpha2' \ --output-file-base=zz_generated.conversion \ --go-header-file=./hack/boilerplate/boilerplate.generatego.txt diff --git a/api/v1alpha1/conversion_test.go b/api/v1alpha1/conversion_test.go index 9499f87f4..3353b1069 100644 --- a/api/v1alpha1/conversion_test.go +++ b/api/v1alpha1/conversion_test.go @@ -17,7 +17,7 @@ import ( "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - nextver "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + nextver "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) var _ = Describe("FuzzyConversion", Label(testlabels.API, testlabels.Fuzz), func() { @@ -310,6 +310,14 @@ func overrideVirtualMachineImageFieldsFuncs(codecs runtimeserializer.CodecFactor // TODO: Need to save serialized object to support lossless conversions. imageStatus.Capabilities = nil }, + func(imageSpec *nextver.VirtualMachineImageSpec, c fuzz.Continue) { + c.Fuzz(imageSpec) + if pr := imageSpec.ProviderRef; pr != nil { + if pr.APIVersion == "" && pr.Kind == "" && pr.Name == "" { + imageSpec.ProviderRef = nil + } + } + }, } } diff --git a/api/v1alpha1/doc.go b/api/v1alpha1/doc.go index a633ff328..ee25a6b0c 100644 --- a/api/v1alpha1/doc.go +++ b/api/v1alpha1/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 VMware, Inc. All Rights Reserved. +// Copyright (c) 2020-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // Package v1alpha1 contains the VM Operator v1alpha1 APIs. @@ -6,5 +6,5 @@ // +k8s:openapi-gen=true // +kubebuilder:object:generate=true // +groupName=vmoperator.vmware.com -// +k8s:conversion-gen=github.com/vmware-tanzu/vm-operator/api/v1alpha2 +// +k8s:conversion-gen=github.com/vmware-tanzu/vm-operator/api/v1alpha3 package v1alpha1 diff --git a/api/v1alpha1/virtualmachine_conversion.go b/api/v1alpha1/virtualmachine_conversion.go index 4a19c8c7b..cdb50d043 100644 --- a/api/v1alpha1/virtualmachine_conversion.go +++ b/api/v1alpha1/virtualmachine_conversion.go @@ -17,8 +17,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/conversion" "github.com/vmware-tanzu/vm-operator/api/utilconversion" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" ) const ( @@ -26,18 +26,18 @@ const ( bootDiskDeviceKey = 2000 ) -func Convert_v1alpha1_VirtualMachineVolume_To_v1alpha2_VirtualMachineVolume( - in *VirtualMachineVolume, out *v1alpha2.VirtualMachineVolume, s apiconversion.Scope) error { +func Convert_v1alpha1_VirtualMachineVolume_To_v1alpha3_VirtualMachineVolume( + in *VirtualMachineVolume, out *v1alpha3.VirtualMachineVolume, s apiconversion.Scope) error { if claim := in.PersistentVolumeClaim; claim != nil { - out.PersistentVolumeClaim = &v1alpha2.PersistentVolumeClaimVolumeSource{ + out.PersistentVolumeClaim = &v1alpha3.PersistentVolumeClaimVolumeSource{ PersistentVolumeClaimVolumeSource: claim.PersistentVolumeClaimVolumeSource, } if claim.InstanceVolumeClaim != nil { - out.PersistentVolumeClaim.InstanceVolumeClaim = &v1alpha2.InstanceVolumeClaimVolumeSource{} + out.PersistentVolumeClaim.InstanceVolumeClaim = &v1alpha3.InstanceVolumeClaimVolumeSource{} - if err := Convert_v1alpha1_InstanceVolumeClaimVolumeSource_To_v1alpha2_InstanceVolumeClaimVolumeSource( + if err := Convert_v1alpha1_InstanceVolumeClaimVolumeSource_To_v1alpha3_InstanceVolumeClaimVolumeSource( claim.InstanceVolumeClaim, out.PersistentVolumeClaim.InstanceVolumeClaim, s); err != nil { return err } @@ -46,76 +46,76 @@ func Convert_v1alpha1_VirtualMachineVolume_To_v1alpha2_VirtualMachineVolume( // NOTE: in.VsphereVolume is dropped in v1a2. See filter_out_VirtualMachineVolumes_VsphereVolumes(). - return autoConvert_v1alpha1_VirtualMachineVolume_To_v1alpha2_VirtualMachineVolume(in, out, s) + return autoConvert_v1alpha1_VirtualMachineVolume_To_v1alpha3_VirtualMachineVolume(in, out, s) } -func convert_v1alpha1_VirtualMachinePowerState_To_v1alpha2_VirtualMachinePowerState( - in VirtualMachinePowerState) v1alpha2.VirtualMachinePowerState { +func convert_v1alpha1_VirtualMachinePowerState_To_v1alpha3_VirtualMachinePowerState( + in VirtualMachinePowerState) v1alpha3.VirtualMachinePowerState { switch in { case VirtualMachinePoweredOff: - return v1alpha2.VirtualMachinePowerStateOff + return v1alpha3.VirtualMachinePowerStateOff case VirtualMachinePoweredOn: - return v1alpha2.VirtualMachinePowerStateOn + return v1alpha3.VirtualMachinePowerStateOn case VirtualMachineSuspended: - return v1alpha2.VirtualMachinePowerStateSuspended + return v1alpha3.VirtualMachinePowerStateSuspended } - return v1alpha2.VirtualMachinePowerState(in) + return v1alpha3.VirtualMachinePowerState(in) } -func convert_v1alpha2_VirtualMachinePowerState_To_v1alpha1_VirtualMachinePowerState( - in v1alpha2.VirtualMachinePowerState) VirtualMachinePowerState { +func convert_v1alpha3_VirtualMachinePowerState_To_v1alpha1_VirtualMachinePowerState( + in v1alpha3.VirtualMachinePowerState) VirtualMachinePowerState { switch in { - case v1alpha2.VirtualMachinePowerStateOff: + case v1alpha3.VirtualMachinePowerStateOff: return VirtualMachinePoweredOff - case v1alpha2.VirtualMachinePowerStateOn: + case v1alpha3.VirtualMachinePowerStateOn: return VirtualMachinePoweredOn - case v1alpha2.VirtualMachinePowerStateSuspended: + case v1alpha3.VirtualMachinePowerStateSuspended: return VirtualMachineSuspended } return VirtualMachinePowerState(in) } -func convert_v1alpha1_VirtualMachinePowerOpMode_To_v1alpha2_VirtualMachinePowerOpMode( - in VirtualMachinePowerOpMode) v1alpha2.VirtualMachinePowerOpMode { +func convert_v1alpha1_VirtualMachinePowerOpMode_To_v1alpha3_VirtualMachinePowerOpMode( + in VirtualMachinePowerOpMode) v1alpha3.VirtualMachinePowerOpMode { switch in { case VirtualMachinePowerOpModeHard: - return v1alpha2.VirtualMachinePowerOpModeHard + return v1alpha3.VirtualMachinePowerOpModeHard case VirtualMachinePowerOpModeSoft: - return v1alpha2.VirtualMachinePowerOpModeSoft + return v1alpha3.VirtualMachinePowerOpModeSoft case VirtualMachinePowerOpModeTrySoft: - return v1alpha2.VirtualMachinePowerOpModeTrySoft + return v1alpha3.VirtualMachinePowerOpModeTrySoft } - return v1alpha2.VirtualMachinePowerOpMode(in) + return v1alpha3.VirtualMachinePowerOpMode(in) } -func convert_v1alpha2_VirtualMachinePowerOpMode_To_v1alpha1_VirtualMachinePowerOpMode( - in v1alpha2.VirtualMachinePowerOpMode) VirtualMachinePowerOpMode { +func convert_v1alpha3_VirtualMachinePowerOpMode_To_v1alpha1_VirtualMachinePowerOpMode( + in v1alpha3.VirtualMachinePowerOpMode) VirtualMachinePowerOpMode { switch in { - case v1alpha2.VirtualMachinePowerOpModeHard: + case v1alpha3.VirtualMachinePowerOpModeHard: return VirtualMachinePowerOpModeHard - case v1alpha2.VirtualMachinePowerOpModeSoft: + case v1alpha3.VirtualMachinePowerOpModeSoft: return VirtualMachinePowerOpModeSoft - case v1alpha2.VirtualMachinePowerOpModeTrySoft: + case v1alpha3.VirtualMachinePowerOpModeTrySoft: return VirtualMachinePowerOpModeTrySoft } return VirtualMachinePowerOpMode(in) } -func convert_v1alpha2_Conditions_To_v1alpha1_Phase( +func convert_v1alpha3_Conditions_To_v1alpha1_Phase( in []metav1.Condition) VMStatusPhase { // In practice, "Created" is the only really important value because some consumers // like CAPI use that as a part of their VM is-ready check. for _, c := range in { - if c.Type == v1alpha2.VirtualMachineConditionCreated { + if c.Type == v1alpha3.VirtualMachineConditionCreated { if c.Status == metav1.ConditionTrue { return Created } @@ -126,8 +126,8 @@ func convert_v1alpha2_Conditions_To_v1alpha1_Phase( return Unknown } -func Convert_v1alpha2_VirtualMachineVolume_To_v1alpha1_VirtualMachineVolume( - in *v1alpha2.VirtualMachineVolume, out *VirtualMachineVolume, s apiconversion.Scope) error { +func Convert_v1alpha3_VirtualMachineVolume_To_v1alpha1_VirtualMachineVolume( + in *v1alpha3.VirtualMachineVolume, out *VirtualMachineVolume, s apiconversion.Scope) error { if claim := in.PersistentVolumeClaim; claim != nil { out.PersistentVolumeClaim = &PersistentVolumeClaimVolumeSource{ @@ -137,24 +137,24 @@ func Convert_v1alpha2_VirtualMachineVolume_To_v1alpha1_VirtualMachineVolume( if claim.InstanceVolumeClaim != nil { out.PersistentVolumeClaim.InstanceVolumeClaim = &InstanceVolumeClaimVolumeSource{} - if err := Convert_v1alpha2_InstanceVolumeClaimVolumeSource_To_v1alpha1_InstanceVolumeClaimVolumeSource( + if err := Convert_v1alpha3_InstanceVolumeClaimVolumeSource_To_v1alpha1_InstanceVolumeClaimVolumeSource( claim.InstanceVolumeClaim, out.PersistentVolumeClaim.InstanceVolumeClaim, s); err != nil { return err } } } - return autoConvert_v1alpha2_VirtualMachineVolume_To_v1alpha1_VirtualMachineVolume(in, out, s) + return autoConvert_v1alpha3_VirtualMachineVolume_To_v1alpha1_VirtualMachineVolume(in, out, s) } -func convert_v1alpha1_VmMetadata_To_v1alpha2_BootstrapSpec( - in *VirtualMachineMetadata) *v1alpha2.VirtualMachineBootstrapSpec { +func convert_v1alpha1_VmMetadata_To_v1alpha3_BootstrapSpec( + in *VirtualMachineMetadata) *v1alpha3.VirtualMachineBootstrapSpec { if in == nil || apiequality.Semantic.DeepEqual(*in, VirtualMachineMetadata{}) { return nil } - out := v1alpha2.VirtualMachineBootstrapSpec{} + out := v1alpha3.VirtualMachineBootstrapSpec{} objectName := in.SecretName if objectName == "" { @@ -165,9 +165,9 @@ func convert_v1alpha1_VmMetadata_To_v1alpha2_BootstrapSpec( case VirtualMachineMetadataExtraConfigTransport: // This transport is obsolete. It should be combined with LinuxPrep but in v1a2 we don't // allow CloudInit w/ LinuxPrep. - // out.LinuxPrep = &v1alpha2.VirtualMachineBootstrapLinuxPrepSpec{HardwareClockIsUTC: true} + // out.LinuxPrep = &v1alpha3.VirtualMachineBootstrapLinuxPrepSpec{HardwareClockIsUTC: true} - out.CloudInit = &v1alpha2.VirtualMachineBootstrapCloudInitSpec{} + out.CloudInit = &v1alpha3.VirtualMachineBootstrapCloudInitSpec{} if objectName != "" { out.CloudInit.RawCloudConfig = &common.SecretKeySelector{ Name: objectName, @@ -175,18 +175,18 @@ func convert_v1alpha1_VmMetadata_To_v1alpha2_BootstrapSpec( } } case VirtualMachineMetadataOvfEnvTransport: - out.LinuxPrep = &v1alpha2.VirtualMachineBootstrapLinuxPrepSpec{ + out.LinuxPrep = &v1alpha3.VirtualMachineBootstrapLinuxPrepSpec{ HardwareClockIsUTC: true, } - out.VAppConfig = &v1alpha2.VirtualMachineBootstrapVAppConfigSpec{ + out.VAppConfig = &v1alpha3.VirtualMachineBootstrapVAppConfigSpec{ RawProperties: objectName, } case VirtualMachineMetadataVAppConfigTransport: - out.VAppConfig = &v1alpha2.VirtualMachineBootstrapVAppConfigSpec{ + out.VAppConfig = &v1alpha3.VirtualMachineBootstrapVAppConfigSpec{ RawProperties: objectName, } case VirtualMachineMetadataCloudInitTransport: - out.CloudInit = &v1alpha2.VirtualMachineBootstrapCloudInitSpec{} + out.CloudInit = &v1alpha3.VirtualMachineBootstrapCloudInitSpec{} if objectName != "" { out.CloudInit.RawCloudConfig = &common.SecretKeySelector{ Name: objectName, @@ -194,7 +194,7 @@ func convert_v1alpha1_VmMetadata_To_v1alpha2_BootstrapSpec( } } case VirtualMachineMetadataSysprepTransport: - out.Sysprep = &v1alpha2.VirtualMachineBootstrapSysprepSpec{} + out.Sysprep = &v1alpha3.VirtualMachineBootstrapSysprepSpec{} if objectName != "" { out.Sysprep.RawSysprep = &common.SecretKeySelector{ Name: objectName, @@ -206,10 +206,10 @@ func convert_v1alpha1_VmMetadata_To_v1alpha2_BootstrapSpec( return &out } -func convert_v1alpha2_BootstrapSpec_To_v1alpha1_VmMetadata( - in *v1alpha2.VirtualMachineBootstrapSpec) *VirtualMachineMetadata { +func convert_v1alpha3_BootstrapSpec_To_v1alpha1_VmMetadata( + in *v1alpha3.VirtualMachineBootstrapSpec) *VirtualMachineMetadata { - if in == nil || apiequality.Semantic.DeepEqual(*in, v1alpha2.VirtualMachineBootstrapSpec{}) { + if in == nil || apiequality.Semantic.DeepEqual(*in, v1alpha3.VirtualMachineBootstrapSpec{}) { return nil } @@ -251,11 +251,16 @@ func convert_v1alpha2_BootstrapSpec_To_v1alpha1_VmMetadata( return out } -func convert_v1alpha1_NetworkInterface_To_v1alpha2_NetworkInterfaceSpec( - idx int, in VirtualMachineNetworkInterface) v1alpha2.VirtualMachineNetworkInterfaceSpec { +func convert_v1alpha1_NetworkInterface_To_v1alpha3_NetworkInterfaceSpec( + idx int, in VirtualMachineNetworkInterface) v1alpha3.VirtualMachineNetworkInterfaceSpec { - out := v1alpha2.VirtualMachineNetworkInterfaceSpec{} + out := v1alpha3.VirtualMachineNetworkInterfaceSpec{} out.Name = fmt.Sprintf("eth%d", idx) + + if in.NetworkName != "" || in.NetworkType != "" { + out.Network = &common.PartialObjectRef{} + } + out.Network.Name = in.NetworkName switch in.NetworkType { @@ -276,8 +281,12 @@ func convert_v1alpha1_NetworkInterface_To_v1alpha2_NetworkInterfaceSpec( return out } -func convert_v1alpha2_NetworkInterfaceSpec_To_v1alpha1_NetworkInterface( - in v1alpha2.VirtualMachineNetworkInterfaceSpec) VirtualMachineNetworkInterface { +func convert_v1alpha3_NetworkInterfaceSpec_To_v1alpha1_NetworkInterface( + in v1alpha3.VirtualMachineNetworkInterfaceSpec) VirtualMachineNetworkInterface { + + if in.Network == nil { + return VirtualMachineNetworkInterface{} + } out := VirtualMachineNetworkInterface{ NetworkName: in.Network.Name, @@ -297,8 +306,8 @@ func convert_v1alpha2_NetworkInterfaceSpec_To_v1alpha1_NetworkInterface( return out } -func Convert_v1alpha1_Probe_To_v1alpha2_VirtualMachineReadinessProbeSpec(in *Probe, out *v1alpha2.VirtualMachineReadinessProbeSpec, s apiconversion.Scope) error { - probeSpec := convert_v1alpha1_Probe_To_v1alpha2_ReadinessProbeSpec(in) +func Convert_v1alpha1_Probe_To_v1alpha3_VirtualMachineReadinessProbeSpec(in *Probe, out *v1alpha3.VirtualMachineReadinessProbeSpec, s apiconversion.Scope) error { + probeSpec := convert_v1alpha1_Probe_To_v1alpha3_ReadinessProbeSpec(in) if probeSpec != nil { *out = *probeSpec } @@ -306,27 +315,27 @@ func Convert_v1alpha1_Probe_To_v1alpha2_VirtualMachineReadinessProbeSpec(in *Pro return nil } -func convert_v1alpha1_Probe_To_v1alpha2_ReadinessProbeSpec(in *Probe) *v1alpha2.VirtualMachineReadinessProbeSpec { +func convert_v1alpha1_Probe_To_v1alpha3_ReadinessProbeSpec(in *Probe) *v1alpha3.VirtualMachineReadinessProbeSpec { if in == nil || apiequality.Semantic.DeepEqual(*in, Probe{}) { return nil } - out := v1alpha2.VirtualMachineReadinessProbeSpec{} + out := v1alpha3.VirtualMachineReadinessProbeSpec{} out.TimeoutSeconds = in.TimeoutSeconds out.PeriodSeconds = in.PeriodSeconds if in.TCPSocket != nil { - out.TCPSocket = &v1alpha2.TCPSocketAction{ + out.TCPSocket = &v1alpha3.TCPSocketAction{ Port: in.TCPSocket.Port, Host: in.TCPSocket.Host, } } if in.GuestHeartbeat != nil { - out.GuestHeartbeat = &v1alpha2.GuestHeartbeatAction{ - ThresholdStatus: v1alpha2.GuestHeartbeatStatus(in.GuestHeartbeat.ThresholdStatus), + out.GuestHeartbeat = &v1alpha3.GuestHeartbeatAction{ + ThresholdStatus: v1alpha3.GuestHeartbeatStatus(in.GuestHeartbeat.ThresholdStatus), } } @@ -335,8 +344,8 @@ func convert_v1alpha1_Probe_To_v1alpha2_ReadinessProbeSpec(in *Probe) *v1alpha2. return &out } -func Convert_v1alpha2_VirtualMachineReadinessProbeSpec_To_v1alpha1_Probe(in *v1alpha2.VirtualMachineReadinessProbeSpec, out *Probe, s apiconversion.Scope) error { - probe := convert_v1alpha2_ReadinessProbeSpec_To_v1alpha1_Probe(in) +func Convert_v1alpha3_VirtualMachineReadinessProbeSpec_To_v1alpha1_Probe(in *v1alpha3.VirtualMachineReadinessProbeSpec, out *Probe, s apiconversion.Scope) error { + probe := convert_v1alpha3_ReadinessProbeSpec_To_v1alpha1_Probe(in) if probe != nil { *out = *probe } @@ -344,9 +353,9 @@ func Convert_v1alpha2_VirtualMachineReadinessProbeSpec_To_v1alpha1_Probe(in *v1a return nil } -func convert_v1alpha2_ReadinessProbeSpec_To_v1alpha1_Probe(in *v1alpha2.VirtualMachineReadinessProbeSpec) *Probe { +func convert_v1alpha3_ReadinessProbeSpec_To_v1alpha1_Probe(in *v1alpha3.VirtualMachineReadinessProbeSpec) *Probe { - if in == nil || apiequality.Semantic.DeepEqual(*in, v1alpha2.VirtualMachineReadinessProbeSpec{}) { + if in == nil || apiequality.Semantic.DeepEqual(*in, v1alpha3.VirtualMachineReadinessProbeSpec{}) { return nil } @@ -371,28 +380,28 @@ func convert_v1alpha2_ReadinessProbeSpec_To_v1alpha1_Probe(in *v1alpha2.VirtualM return out } -func convert_v1alpha1_VirtualMachineAdvancedOptions_To_v1alpha2_VirtualMachineAdvancedSpec( - in *VirtualMachineAdvancedOptions, inVolumes []VirtualMachineVolume) *v1alpha2.VirtualMachineAdvancedSpec { +func convert_v1alpha1_VirtualMachineAdvancedOptions_To_v1alpha3_VirtualMachineAdvancedSpec( + in *VirtualMachineAdvancedOptions, inVolumes []VirtualMachineVolume) *v1alpha3.VirtualMachineAdvancedSpec { - bootDiskCapacity := convert_v1alpha1_VsphereVolumes_To_v1alpha2_BootDiskCapacity(inVolumes) + bootDiskCapacity := convert_v1alpha1_VsphereVolumes_To_v1alpha3_BootDiskCapacity(inVolumes) if (in == nil || apiequality.Semantic.DeepEqual(*in, VirtualMachineAdvancedOptions{})) && bootDiskCapacity == nil { return nil } - out := v1alpha2.VirtualMachineAdvancedSpec{} + out := v1alpha3.VirtualMachineAdvancedSpec{} out.BootDiskCapacity = bootDiskCapacity if in != nil { if opts := in.DefaultVolumeProvisioningOptions; opts != nil { if opts.ThinProvisioned != nil { if *opts.ThinProvisioned { - out.DefaultVolumeProvisioningMode = v1alpha2.VirtualMachineVolumeProvisioningModeThin + out.DefaultVolumeProvisioningMode = v1alpha3.VirtualMachineVolumeProvisioningModeThin } else { - out.DefaultVolumeProvisioningMode = v1alpha2.VirtualMachineVolumeProvisioningModeThick + out.DefaultVolumeProvisioningMode = v1alpha3.VirtualMachineVolumeProvisioningModeThick } } else if opts.EagerZeroed != nil && *opts.EagerZeroed { - out.DefaultVolumeProvisioningMode = v1alpha2.VirtualMachineVolumeProvisioningModeThickEagerZero + out.DefaultVolumeProvisioningMode = v1alpha3.VirtualMachineVolumeProvisioningModeThickEagerZero } } @@ -404,7 +413,7 @@ func convert_v1alpha1_VirtualMachineAdvancedOptions_To_v1alpha2_VirtualMachineAd return &out } -func convert_v1alpha1_VsphereVolumes_To_v1alpha2_BootDiskCapacity(volumes []VirtualMachineVolume) *resource.Quantity { +func convert_v1alpha1_VsphereVolumes_To_v1alpha3_BootDiskCapacity(volumes []VirtualMachineVolume) *resource.Quantity { // The v1a1 VsphereVolume was never a great API as you had to know the DeviceKey upfront; at the time our // API was private - only used by CAPW - and predates the "VM Service" VMs; In v1a2, we only support resizing // the boot disk via an explicit field. As good as we can here, map v1a1 volume into the v1a2 specific field. @@ -424,10 +433,10 @@ func convert_v1alpha1_VsphereVolumes_To_v1alpha2_BootDiskCapacity(volumes []Virt return nil } -func convert_v1alpha2_VirtualMachineAdvancedSpec_To_v1alpha1_VirtualMachineAdvancedOptions( - in *v1alpha2.VirtualMachineAdvancedSpec) *VirtualMachineAdvancedOptions { +func convert_v1alpha3_VirtualMachineAdvancedSpec_To_v1alpha1_VirtualMachineAdvancedOptions( + in *v1alpha3.VirtualMachineAdvancedSpec) *VirtualMachineAdvancedOptions { - if in == nil || apiequality.Semantic.DeepEqual(*in, v1alpha2.VirtualMachineAdvancedSpec{}) { + if in == nil || apiequality.Semantic.DeepEqual(*in, v1alpha3.VirtualMachineAdvancedSpec{}) { return nil } @@ -438,15 +447,15 @@ func convert_v1alpha2_VirtualMachineAdvancedSpec_To_v1alpha1_VirtualMachineAdvan } switch in.DefaultVolumeProvisioningMode { - case v1alpha2.VirtualMachineVolumeProvisioningModeThin: + case v1alpha3.VirtualMachineVolumeProvisioningModeThin: out.DefaultVolumeProvisioningOptions = &VirtualMachineVolumeProvisioningOptions{ ThinProvisioned: ptr.To(true), } - case v1alpha2.VirtualMachineVolumeProvisioningModeThick: + case v1alpha3.VirtualMachineVolumeProvisioningModeThick: out.DefaultVolumeProvisioningOptions = &VirtualMachineVolumeProvisioningOptions{ ThinProvisioned: ptr.To(false), } - case v1alpha2.VirtualMachineVolumeProvisioningModeThickEagerZero: + case v1alpha3.VirtualMachineVolumeProvisioningModeThickEagerZero: out.DefaultVolumeProvisioningOptions = &VirtualMachineVolumeProvisioningOptions{ EagerZeroed: ptr.To(true), } @@ -459,7 +468,7 @@ func convert_v1alpha2_VirtualMachineAdvancedSpec_To_v1alpha1_VirtualMachineAdvan return out } -func convert_v1alpha2_BootDiskCapacity_To_v1alpha1_VirtualMachineVolume(capacity *resource.Quantity) *VirtualMachineVolume { +func convert_v1alpha3_BootDiskCapacity_To_v1alpha1_VirtualMachineVolume(capacity *resource.Quantity) *VirtualMachineVolume { if capacity == nil { return nil } @@ -477,14 +486,14 @@ func convert_v1alpha2_BootDiskCapacity_To_v1alpha1_VirtualMachineVolume(capacity } } -func convert_v1alpha1_Network_To_v1alpha2_NetworkStatus( - vmIP string, in []NetworkInterfaceStatus) *v1alpha2.VirtualMachineNetworkStatus { +func convert_v1alpha1_Network_To_v1alpha3_NetworkStatus( + vmIP string, in []NetworkInterfaceStatus) *v1alpha3.VirtualMachineNetworkStatus { if vmIP == "" && len(in) == 0 { return nil } - out := &v1alpha2.VirtualMachineNetworkStatus{} + out := &v1alpha3.VirtualMachineNetworkStatus{} if net.ParseIP(vmIP).To4() != nil { out.PrimaryIP4 = vmIP @@ -492,17 +501,17 @@ func convert_v1alpha1_Network_To_v1alpha2_NetworkStatus( out.PrimaryIP6 = vmIP } - ipAddrsToAddrStatus := func(ipAddr []string) []v1alpha2.VirtualMachineNetworkInterfaceIPAddrStatus { - statuses := make([]v1alpha2.VirtualMachineNetworkInterfaceIPAddrStatus, 0, len(ipAddr)) + ipAddrsToAddrStatus := func(ipAddr []string) []v1alpha3.VirtualMachineNetworkInterfaceIPAddrStatus { + statuses := make([]v1alpha3.VirtualMachineNetworkInterfaceIPAddrStatus, 0, len(ipAddr)) for _, ip := range ipAddr { - statuses = append(statuses, v1alpha2.VirtualMachineNetworkInterfaceIPAddrStatus{Address: ip}) + statuses = append(statuses, v1alpha3.VirtualMachineNetworkInterfaceIPAddrStatus{Address: ip}) } return statuses } for _, inI := range in { - interfaceStatus := v1alpha2.VirtualMachineNetworkInterfaceStatus{ - IP: &v1alpha2.VirtualMachineNetworkInterfaceIPStatus{ + interfaceStatus := v1alpha3.VirtualMachineNetworkInterfaceStatus{ + IP: &v1alpha3.VirtualMachineNetworkInterfaceIPStatus{ Addresses: ipAddrsToAddrStatus(inI.IpAddresses), MACAddr: inI.MacAddress, }, @@ -513,8 +522,8 @@ func convert_v1alpha1_Network_To_v1alpha2_NetworkStatus( return out } -func convert_v1alpha2_NetworkStatus_To_v1alpha1_Network( - in *v1alpha2.VirtualMachineNetworkStatus) (string, []NetworkInterfaceStatus) { +func convert_v1alpha3_NetworkStatus_To_v1alpha1_Network( + in *v1alpha3.VirtualMachineNetworkStatus) (string, []NetworkInterfaceStatus) { if in == nil { return "", nil @@ -525,7 +534,7 @@ func convert_v1alpha2_NetworkStatus_To_v1alpha1_Network( vmIP = in.PrimaryIP6 } - addrStatusToIPAddrs := func(addrStatus []v1alpha2.VirtualMachineNetworkInterfaceIPAddrStatus) []string { + addrStatusToIPAddrs := func(addrStatus []v1alpha3.VirtualMachineNetworkInterfaceIPAddrStatus) []string { ipAddrs := make([]string, 0, len(addrStatus)) for _, a := range addrStatus { ipAddrs = append(ipAddrs, a.Address) @@ -549,15 +558,15 @@ func convert_v1alpha2_NetworkStatus_To_v1alpha1_Network( } // In v1a2 we've dropped the v1a1 VsphereVolumes, and in its place we have a single field for the boot -// disk size. The Convert_v1alpha1_VirtualMachineVolume_To_v1alpha2_VirtualMachineVolume() stub does not +// disk size. The Convert_v1alpha1_VirtualMachineVolume_To_v1alpha3_VirtualMachineVolume() stub does not // allow us to not return something so filter those volumes - without a PersistentVolumeClaim set - here. -func filter_out_VirtualMachineVolumes_VsphereVolumes(in []v1alpha2.VirtualMachineVolume) []v1alpha2.VirtualMachineVolume { +func filter_out_VirtualMachineVolumes_VsphereVolumes(in []v1alpha3.VirtualMachineVolume) []v1alpha3.VirtualMachineVolume { if len(in) == 0 { return nil } - out := make([]v1alpha2.VirtualMachineVolume, 0, len(in)) + out := make([]v1alpha3.VirtualMachineVolume, 0, len(in)) for _, v := range in { if v.PersistentVolumeClaim != nil { @@ -572,37 +581,37 @@ func filter_out_VirtualMachineVolumes_VsphereVolumes(in []v1alpha2.VirtualMachin return out } -func Convert_v1alpha1_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec( - in *VirtualMachineSpec, out *v1alpha2.VirtualMachineSpec, s apiconversion.Scope) error { +func Convert_v1alpha1_VirtualMachineSpec_To_v1alpha3_VirtualMachineSpec( + in *VirtualMachineSpec, out *v1alpha3.VirtualMachineSpec, s apiconversion.Scope) error { // The generated auto convert will convert the power modes as-is strings which breaks things, so keep // this first. - if err := autoConvert_v1alpha1_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec(in, out, s); err != nil { + if err := autoConvert_v1alpha1_VirtualMachineSpec_To_v1alpha3_VirtualMachineSpec(in, out, s); err != nil { return err } - out.PowerState = convert_v1alpha1_VirtualMachinePowerState_To_v1alpha2_VirtualMachinePowerState(in.PowerState) - out.PowerOffMode = convert_v1alpha1_VirtualMachinePowerOpMode_To_v1alpha2_VirtualMachinePowerOpMode(in.PowerOffMode) - out.SuspendMode = convert_v1alpha1_VirtualMachinePowerOpMode_To_v1alpha2_VirtualMachinePowerOpMode(in.SuspendMode) + out.PowerState = convert_v1alpha1_VirtualMachinePowerState_To_v1alpha3_VirtualMachinePowerState(in.PowerState) + out.PowerOffMode = convert_v1alpha1_VirtualMachinePowerOpMode_To_v1alpha3_VirtualMachinePowerOpMode(in.PowerOffMode) + out.SuspendMode = convert_v1alpha1_VirtualMachinePowerOpMode_To_v1alpha3_VirtualMachinePowerOpMode(in.SuspendMode) out.NextRestartTime = in.NextRestartTime - out.RestartMode = convert_v1alpha1_VirtualMachinePowerOpMode_To_v1alpha2_VirtualMachinePowerOpMode(in.RestartMode) - out.Bootstrap = convert_v1alpha1_VmMetadata_To_v1alpha2_BootstrapSpec(in.VmMetadata) + out.RestartMode = convert_v1alpha1_VirtualMachinePowerOpMode_To_v1alpha3_VirtualMachinePowerOpMode(in.RestartMode) + out.Bootstrap = convert_v1alpha1_VmMetadata_To_v1alpha3_BootstrapSpec(in.VmMetadata) out.Volumes = filter_out_VirtualMachineVolumes_VsphereVolumes(out.Volumes) if len(in.NetworkInterfaces) > 0 { - out.Network = &v1alpha2.VirtualMachineNetworkSpec{} + out.Network = &v1alpha3.VirtualMachineNetworkSpec{} for i, networkInterface := range in.NetworkInterfaces { - networkInterfaceSpec := convert_v1alpha1_NetworkInterface_To_v1alpha2_NetworkInterfaceSpec(i, networkInterface) + networkInterfaceSpec := convert_v1alpha1_NetworkInterface_To_v1alpha3_NetworkInterfaceSpec(i, networkInterface) out.Network.Interfaces = append(out.Network.Interfaces, networkInterfaceSpec) } } - out.ReadinessProbe = convert_v1alpha1_Probe_To_v1alpha2_ReadinessProbeSpec(in.ReadinessProbe) - out.Advanced = convert_v1alpha1_VirtualMachineAdvancedOptions_To_v1alpha2_VirtualMachineAdvancedSpec(in.AdvancedOptions, in.Volumes) + out.ReadinessProbe = convert_v1alpha1_Probe_To_v1alpha3_ReadinessProbeSpec(in.ReadinessProbe) + out.Advanced = convert_v1alpha1_VirtualMachineAdvancedOptions_To_v1alpha3_VirtualMachineAdvancedSpec(in.AdvancedOptions, in.Volumes) if in.ResourcePolicyName != "" { if out.Reserved == nil { - out.Reserved = &v1alpha2.VirtualMachineReservedSpec{} + out.Reserved = &v1alpha3.VirtualMachineReservedSpec{} } out.Reserved.ResourcePolicyName = in.ResourcePolicyName } @@ -613,37 +622,37 @@ func Convert_v1alpha1_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec( return nil } -func Convert_v1alpha2_VirtualMachineSpec_To_v1alpha1_VirtualMachineSpec( - in *v1alpha2.VirtualMachineSpec, out *VirtualMachineSpec, s apiconversion.Scope) error { +func Convert_v1alpha3_VirtualMachineSpec_To_v1alpha1_VirtualMachineSpec( + in *v1alpha3.VirtualMachineSpec, out *VirtualMachineSpec, s apiconversion.Scope) error { - if err := autoConvert_v1alpha2_VirtualMachineSpec_To_v1alpha1_VirtualMachineSpec(in, out, s); err != nil { + if err := autoConvert_v1alpha3_VirtualMachineSpec_To_v1alpha1_VirtualMachineSpec(in, out, s); err != nil { return err } - out.PowerState = convert_v1alpha2_VirtualMachinePowerState_To_v1alpha1_VirtualMachinePowerState(in.PowerState) - out.PowerOffMode = convert_v1alpha2_VirtualMachinePowerOpMode_To_v1alpha1_VirtualMachinePowerOpMode(in.PowerOffMode) - out.SuspendMode = convert_v1alpha2_VirtualMachinePowerOpMode_To_v1alpha1_VirtualMachinePowerOpMode(in.SuspendMode) + out.PowerState = convert_v1alpha3_VirtualMachinePowerState_To_v1alpha1_VirtualMachinePowerState(in.PowerState) + out.PowerOffMode = convert_v1alpha3_VirtualMachinePowerOpMode_To_v1alpha1_VirtualMachinePowerOpMode(in.PowerOffMode) + out.SuspendMode = convert_v1alpha3_VirtualMachinePowerOpMode_To_v1alpha1_VirtualMachinePowerOpMode(in.SuspendMode) out.NextRestartTime = in.NextRestartTime - out.RestartMode = convert_v1alpha2_VirtualMachinePowerOpMode_To_v1alpha1_VirtualMachinePowerOpMode(in.RestartMode) - out.VmMetadata = convert_v1alpha2_BootstrapSpec_To_v1alpha1_VmMetadata(in.Bootstrap) + out.RestartMode = convert_v1alpha3_VirtualMachinePowerOpMode_To_v1alpha1_VirtualMachinePowerOpMode(in.RestartMode) + out.VmMetadata = convert_v1alpha3_BootstrapSpec_To_v1alpha1_VmMetadata(in.Bootstrap) if in.Network != nil { out.NetworkInterfaces = make([]VirtualMachineNetworkInterface, 0, len(in.Network.Interfaces)) for _, networkInterfaceSpec := range in.Network.Interfaces { - networkInterface := convert_v1alpha2_NetworkInterfaceSpec_To_v1alpha1_NetworkInterface(networkInterfaceSpec) + networkInterface := convert_v1alpha3_NetworkInterfaceSpec_To_v1alpha1_NetworkInterface(networkInterfaceSpec) out.NetworkInterfaces = append(out.NetworkInterfaces, networkInterface) } } - out.ReadinessProbe = convert_v1alpha2_ReadinessProbeSpec_To_v1alpha1_Probe(in.ReadinessProbe) - out.AdvancedOptions = convert_v1alpha2_VirtualMachineAdvancedSpec_To_v1alpha1_VirtualMachineAdvancedOptions(in.Advanced) + out.ReadinessProbe = convert_v1alpha3_ReadinessProbeSpec_To_v1alpha1_Probe(in.ReadinessProbe) + out.AdvancedOptions = convert_v1alpha3_VirtualMachineAdvancedSpec_To_v1alpha1_VirtualMachineAdvancedOptions(in.Advanced) if in.Reserved != nil { out.ResourcePolicyName = in.Reserved.ResourcePolicyName } if in.Advanced != nil { - if bootDiskVol := convert_v1alpha2_BootDiskCapacity_To_v1alpha1_VirtualMachineVolume(in.Advanced.BootDiskCapacity); bootDiskVol != nil { + if bootDiskVol := convert_v1alpha3_BootDiskCapacity_To_v1alpha1_VirtualMachineVolume(in.Advanced.BootDiskCapacity); bootDiskVol != nil { out.Volumes = append(out.Volumes, *bootDiskVol) } } @@ -656,38 +665,38 @@ func Convert_v1alpha2_VirtualMachineSpec_To_v1alpha1_VirtualMachineSpec( return nil } -func Convert_v1alpha1_VirtualMachineVolumeStatus_To_v1alpha2_VirtualMachineVolumeStatus( - in *VirtualMachineVolumeStatus, out *v1alpha2.VirtualMachineVolumeStatus, s apiconversion.Scope) error { +func Convert_v1alpha1_VirtualMachineVolumeStatus_To_v1alpha3_VirtualMachineVolumeStatus( + in *VirtualMachineVolumeStatus, out *v1alpha3.VirtualMachineVolumeStatus, s apiconversion.Scope) error { out.DiskUUID = in.DiskUuid - return autoConvert_v1alpha1_VirtualMachineVolumeStatus_To_v1alpha2_VirtualMachineVolumeStatus(in, out, s) + return autoConvert_v1alpha1_VirtualMachineVolumeStatus_To_v1alpha3_VirtualMachineVolumeStatus(in, out, s) } -func Convert_v1alpha2_VirtualMachineVolumeStatus_To_v1alpha1_VirtualMachineVolumeStatus( - in *v1alpha2.VirtualMachineVolumeStatus, out *VirtualMachineVolumeStatus, s apiconversion.Scope) error { +func Convert_v1alpha3_VirtualMachineVolumeStatus_To_v1alpha1_VirtualMachineVolumeStatus( + in *v1alpha3.VirtualMachineVolumeStatus, out *VirtualMachineVolumeStatus, s apiconversion.Scope) error { out.DiskUuid = in.DiskUUID - return autoConvert_v1alpha2_VirtualMachineVolumeStatus_To_v1alpha1_VirtualMachineVolumeStatus(in, out, s) + return autoConvert_v1alpha3_VirtualMachineVolumeStatus_To_v1alpha1_VirtualMachineVolumeStatus(in, out, s) } -func Convert_v1alpha1_VirtualMachineStatus_To_v1alpha2_VirtualMachineStatus( - in *VirtualMachineStatus, out *v1alpha2.VirtualMachineStatus, s apiconversion.Scope) error { +func Convert_v1alpha1_VirtualMachineStatus_To_v1alpha3_VirtualMachineStatus( + in *VirtualMachineStatus, out *v1alpha3.VirtualMachineStatus, s apiconversion.Scope) error { - if err := autoConvert_v1alpha1_VirtualMachineStatus_To_v1alpha2_VirtualMachineStatus(in, out, s); err != nil { + if err := autoConvert_v1alpha1_VirtualMachineStatus_To_v1alpha3_VirtualMachineStatus(in, out, s); err != nil { return err } - out.PowerState = convert_v1alpha1_VirtualMachinePowerState_To_v1alpha2_VirtualMachinePowerState(in.PowerState) - out.Network = convert_v1alpha1_Network_To_v1alpha2_NetworkStatus(in.VmIp, in.NetworkInterfaces) + out.PowerState = convert_v1alpha1_VirtualMachinePowerState_To_v1alpha3_VirtualMachinePowerState(in.PowerState) + out.Network = convert_v1alpha1_Network_To_v1alpha3_NetworkStatus(in.VmIp, in.NetworkInterfaces) // WARNING: in.Phase requires manual conversion: does not exist in peer-type return nil } -func translate_v1alpha2_Conditions_To_v1alpha1_Conditions(conditions []Condition) []Condition { +func translate_v1alpha3_Conditions_To_v1alpha1_Conditions(conditions []Condition) []Condition { var preReqCond, vmClassCond, vmImageCond, vmSetResourcePolicyCond, vmBootstrapCond *Condition for i := range conditions { @@ -696,13 +705,13 @@ func translate_v1alpha2_Conditions_To_v1alpha1_Conditions(conditions []Condition switch c.Type { case VirtualMachinePrereqReadyCondition: preReqCond = c - case v1alpha2.VirtualMachineConditionClassReady: + case v1alpha3.VirtualMachineConditionClassReady: vmClassCond = c - case v1alpha2.VirtualMachineConditionImageReady: + case v1alpha3.VirtualMachineConditionImageReady: vmImageCond = c - case v1alpha2.VirtualMachineConditionVMSetResourcePolicyReady: + case v1alpha3.VirtualMachineConditionVMSetResourcePolicyReady: vmSetResourcePolicyCond = c - case v1alpha2.VirtualMachineConditionBootstrapReady: + case v1alpha3.VirtualMachineConditionBootstrapReady: vmBootstrapCond = c } } @@ -769,18 +778,18 @@ func translate_v1alpha2_Conditions_To_v1alpha1_Conditions(conditions []Condition return conditions } -func Convert_v1alpha2_VirtualMachineStatus_To_v1alpha1_VirtualMachineStatus( - in *v1alpha2.VirtualMachineStatus, out *VirtualMachineStatus, s apiconversion.Scope) error { +func Convert_v1alpha3_VirtualMachineStatus_To_v1alpha1_VirtualMachineStatus( + in *v1alpha3.VirtualMachineStatus, out *VirtualMachineStatus, s apiconversion.Scope) error { - if err := autoConvert_v1alpha2_VirtualMachineStatus_To_v1alpha1_VirtualMachineStatus(in, out, s); err != nil { + if err := autoConvert_v1alpha3_VirtualMachineStatus_To_v1alpha1_VirtualMachineStatus(in, out, s); err != nil { return err } - out.PowerState = convert_v1alpha2_VirtualMachinePowerState_To_v1alpha1_VirtualMachinePowerState(in.PowerState) - out.Phase = convert_v1alpha2_Conditions_To_v1alpha1_Phase(in.Conditions) - out.VmIp, out.NetworkInterfaces = convert_v1alpha2_NetworkStatus_To_v1alpha1_Network(in.Network) + out.PowerState = convert_v1alpha3_VirtualMachinePowerState_To_v1alpha1_VirtualMachinePowerState(in.PowerState) + out.Phase = convert_v1alpha3_Conditions_To_v1alpha1_Phase(in.Conditions) + out.VmIp, out.NetworkInterfaces = convert_v1alpha3_NetworkStatus_To_v1alpha1_Network(in.Network) out.LastRestartTime = in.LastRestartTime - out.Conditions = translate_v1alpha2_Conditions_To_v1alpha1_Conditions(out.Conditions) + out.Conditions = translate_v1alpha3_Conditions_To_v1alpha1_Conditions(out.Conditions) // WARNING: in.Image requires manual conversion: does not exist in peer-type // WARNING: in.Class requires manual conversion: does not exist in peer-type @@ -788,8 +797,8 @@ func Convert_v1alpha2_VirtualMachineStatus_To_v1alpha1_VirtualMachineStatus( return nil } -func restore_v1alpha2_VirtualMachineBootstrapSpec( - dst, src *v1alpha2.VirtualMachine) { +func restore_v1alpha3_VirtualMachineBootstrapSpec( + dst, src *v1alpha3.VirtualMachine) { srcBootstrap := src.Spec.Bootstrap if srcBootstrap == nil { @@ -800,10 +809,10 @@ func restore_v1alpha2_VirtualMachineBootstrapSpec( dstBootstrap := dst.Spec.Bootstrap if dstBootstrap == nil { // v1a1 doesn't have a way to represent standalone LinuxPrep. If we didn't do a - // conversion in convert_v1alpha1_VmMetadata_To_v1alpha2_BootstrapSpec() but we + // conversion in convert_v1alpha1_VmMetadata_To_v1alpha3_BootstrapSpec() but we // saved a LinuxPrep in the conversion annotation, restore that here. if srcBootstrap.LinuxPrep != nil { - dst.Spec.Bootstrap = &v1alpha2.VirtualMachineBootstrapSpec{ + dst.Spec.Bootstrap = &v1alpha3.VirtualMachineBootstrapSpec{ LinuxPrep: srcBootstrap.LinuxPrep, } } @@ -845,7 +854,7 @@ func restore_v1alpha2_VirtualMachineBootstrapSpec( // because that translates to OvfEnvTransport. If we have a saved vAppConfig initialize the field // so we'll restore it next. if dstBootstrap.VAppConfig == nil && srcBootstrap.VAppConfig != nil { - dstBootstrap.VAppConfig = &v1alpha2.VirtualMachineBootstrapVAppConfigSpec{} + dstBootstrap.VAppConfig = &v1alpha3.VirtualMachineBootstrapVAppConfigSpec{} } } } @@ -858,17 +867,17 @@ func restore_v1alpha2_VirtualMachineBootstrapSpec( } } -func restore_v1alpha2_VirtualMachineNetworkSpec( - dst, src *v1alpha2.VirtualMachine) { +func restore_v1alpha3_VirtualMachineNetworkSpec( + dst, src *v1alpha3.VirtualMachine) { srcNetwork := src.Spec.Network - if srcNetwork == nil || apiequality.Semantic.DeepEqual(*srcNetwork, v1alpha2.VirtualMachineNetworkSpec{}) { + if srcNetwork == nil || apiequality.Semantic.DeepEqual(*srcNetwork, v1alpha3.VirtualMachineNetworkSpec{}) { // Nothing to restore. return } if dst.Spec.Network == nil { - dst.Spec.Network = &v1alpha2.VirtualMachineNetworkSpec{} + dst.Spec.Network = &v1alpha3.VirtualMachineNetworkSpec{} } dstNetwork := dst.Spec.Network @@ -893,28 +902,25 @@ func restore_v1alpha2_VirtualMachineNetworkSpec( if i >= len(srcNetwork.Interfaces) { break } - - networkName := dstNetwork.Interfaces[i].Network.Name - networkType := dstNetwork.Interfaces[i].Network.TypeMeta + savedDstNetRef := dstNetwork.Interfaces[i].Network dstNetwork.Interfaces[i] = srcNetwork.Interfaces[i] - dstNetwork.Interfaces[i].Network.Name = networkName - dstNetwork.Interfaces[i].Network.TypeMeta = networkType + dstNetwork.Interfaces[i].Network = savedDstNetRef } } -func restore_v1alpha2_VirtualMachineReadinessProbeSpec( - dst, src *v1alpha2.VirtualMachine) { +func restore_v1alpha3_VirtualMachineReadinessProbeSpec( + dst, src *v1alpha3.VirtualMachine) { if src.Spec.ReadinessProbe != nil { if dst.Spec.ReadinessProbe == nil { - dst.Spec.ReadinessProbe = &v1alpha2.VirtualMachineReadinessProbeSpec{} + dst.Spec.ReadinessProbe = &v1alpha3.VirtualMachineReadinessProbeSpec{} } dst.Spec.ReadinessProbe.GuestInfo = src.Spec.ReadinessProbe.GuestInfo } } -func convert_v1alpha1_PreReqsReadyCondition_to_v1alpha2_Conditions( - dst *v1alpha2.VirtualMachine) []metav1.Condition { +func convert_v1alpha1_PreReqsReadyCondition_to_v1alpha3_Conditions( + dst *v1alpha3.VirtualMachine) []metav1.Condition { var preReqCond, vmClassCond, vmImageCond, vmSetResourcePolicyCond, vmBootstrapCond *metav1.Condition var preReqCondIdx int @@ -926,13 +932,13 @@ func convert_v1alpha1_PreReqsReadyCondition_to_v1alpha2_Conditions( case string(VirtualMachinePrereqReadyCondition): preReqCond = c preReqCondIdx = i - case v1alpha2.VirtualMachineConditionClassReady: + case v1alpha3.VirtualMachineConditionClassReady: vmClassCond = c - case v1alpha2.VirtualMachineConditionImageReady: + case v1alpha3.VirtualMachineConditionImageReady: vmImageCond = c - case v1alpha2.VirtualMachineConditionVMSetResourcePolicyReady: + case v1alpha3.VirtualMachineConditionVMSetResourcePolicyReady: vmSetResourcePolicyCond = c - case v1alpha2.VirtualMachineConditionBootstrapReady: + case v1alpha3.VirtualMachineConditionBootstrapReady: vmBootstrapCond = c } } @@ -956,13 +962,13 @@ func convert_v1alpha1_PreReqsReadyCondition_to_v1alpha2_Conditions( if preReqCond.Status == metav1.ConditionTrue { // The class and image are always required fields. conditions = append(conditions, metav1.Condition{ - Type: v1alpha2.VirtualMachineConditionClassReady, + Type: v1alpha3.VirtualMachineConditionClassReady, Status: metav1.ConditionTrue, LastTransitionTime: preReqCond.LastTransitionTime, Reason: string(metav1.ConditionTrue), }) conditions = append(conditions, metav1.Condition{ - Type: v1alpha2.VirtualMachineConditionImageReady, + Type: v1alpha3.VirtualMachineConditionImageReady, Status: metav1.ConditionTrue, LastTransitionTime: preReqCond.LastTransitionTime, Reason: string(metav1.ConditionTrue), @@ -970,7 +976,7 @@ func convert_v1alpha1_PreReqsReadyCondition_to_v1alpha2_Conditions( if dst.Spec.Reserved != nil && dst.Spec.Reserved.ResourcePolicyName != "" { conditions = append(conditions, metav1.Condition{ - Type: v1alpha2.VirtualMachineConditionVMSetResourcePolicyReady, + Type: v1alpha3.VirtualMachineConditionVMSetResourcePolicyReady, Status: metav1.ConditionTrue, LastTransitionTime: preReqCond.LastTransitionTime, Reason: string(metav1.ConditionTrue), @@ -978,7 +984,7 @@ func convert_v1alpha1_PreReqsReadyCondition_to_v1alpha2_Conditions( } if dst.Spec.Bootstrap != nil { conditions = append(conditions, metav1.Condition{ - Type: v1alpha2.VirtualMachineConditionBootstrapReady, + Type: v1alpha3.VirtualMachineConditionBootstrapReady, Status: metav1.ConditionTrue, LastTransitionTime: preReqCond.LastTransitionTime, Reason: string(metav1.ConditionTrue), @@ -994,14 +1000,14 @@ func convert_v1alpha1_PreReqsReadyCondition_to_v1alpha2_Conditions( if preReqCond.Reason == VirtualMachineClassNotFoundReason || preReqCond.Reason == VirtualMachineClassBindingNotFoundReason { conditions = append(conditions, metav1.Condition{ - Type: v1alpha2.VirtualMachineConditionClassReady, + Type: v1alpha3.VirtualMachineConditionClassReady, Status: metav1.ConditionFalse, LastTransitionTime: preReqCond.LastTransitionTime, Reason: preReqCond.Reason, }) // v1a1 Image preReq hasn't been evaluated yet -- mark unknown conditions = append(conditions, metav1.Condition{ - Type: v1alpha2.VirtualMachineConditionImageReady, + Type: v1alpha3.VirtualMachineConditionImageReady, Status: metav1.ConditionUnknown, LastTransitionTime: preReqCond.LastTransitionTime, Reason: string(metav1.ConditionUnknown), @@ -1012,13 +1018,13 @@ func convert_v1alpha1_PreReqsReadyCondition_to_v1alpha2_Conditions( preReqCond.Reason == ContentLibraryProviderNotFoundReason { conditions = append(conditions, metav1.Condition{ - Type: v1alpha2.VirtualMachineConditionClassReady, + Type: v1alpha3.VirtualMachineConditionClassReady, Status: metav1.ConditionTrue, LastTransitionTime: preReqCond.LastTransitionTime, Reason: string(metav1.ConditionTrue), }) conditions = append(conditions, metav1.Condition{ - Type: v1alpha2.VirtualMachineConditionImageReady, + Type: v1alpha3.VirtualMachineConditionImageReady, Status: metav1.ConditionFalse, LastTransitionTime: preReqCond.LastTransitionTime, Reason: preReqCond.Reason, @@ -1029,7 +1035,7 @@ func convert_v1alpha1_PreReqsReadyCondition_to_v1alpha2_Conditions( // resourcePolicy is specified in VM Spec. if dst.Spec.Reserved != nil && dst.Spec.Reserved.ResourcePolicyName != "" { conditions = append(conditions, metav1.Condition{ - Type: v1alpha2.VirtualMachineConditionVMSetResourcePolicyReady, + Type: v1alpha3.VirtualMachineConditionVMSetResourcePolicyReady, Status: metav1.ConditionUnknown, LastTransitionTime: preReqCond.LastTransitionTime, Reason: string(metav1.ConditionUnknown), @@ -1040,7 +1046,7 @@ func convert_v1alpha1_PreReqsReadyCondition_to_v1alpha2_Conditions( // bootstrap is specified in VM Spec. if dst.Spec.Bootstrap != nil { conditions = append(conditions, metav1.Condition{ - Type: v1alpha2.VirtualMachineConditionBootstrapReady, + Type: v1alpha3.VirtualMachineConditionBootstrapReady, Status: metav1.ConditionUnknown, LastTransitionTime: preReqCond.LastTransitionTime, Reason: string(metav1.ConditionUnknown), @@ -1053,23 +1059,23 @@ func convert_v1alpha1_PreReqsReadyCondition_to_v1alpha2_Conditions( // ConvertTo converts this VirtualMachine to the Hub version. func (src *VirtualMachine) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha2.VirtualMachine) - if err := Convert_v1alpha1_VirtualMachine_To_v1alpha2_VirtualMachine(src, dst, nil); err != nil { + dst := dstRaw.(*v1alpha3.VirtualMachine) + if err := Convert_v1alpha1_VirtualMachine_To_v1alpha3_VirtualMachine(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &v1alpha2.VirtualMachine{} + restored := &v1alpha3.VirtualMachine{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { // If there is no v1a2 object to restore, this was originally a v1a1 VM // Make sure the v1a1 PreReq conditions are translated over to v1a2 correctly - dst.Status.Conditions = convert_v1alpha1_PreReqsReadyCondition_to_v1alpha2_Conditions(dst) + dst.Status.Conditions = convert_v1alpha1_PreReqsReadyCondition_to_v1alpha3_Conditions(dst) return err } - restore_v1alpha2_VirtualMachineBootstrapSpec(dst, restored) - restore_v1alpha2_VirtualMachineNetworkSpec(dst, restored) - restore_v1alpha2_VirtualMachineReadinessProbeSpec(dst, restored) + restore_v1alpha3_VirtualMachineBootstrapSpec(dst, restored) + restore_v1alpha3_VirtualMachineNetworkSpec(dst, restored) + restore_v1alpha3_VirtualMachineReadinessProbeSpec(dst, restored) dst.Status = restored.Status @@ -1078,8 +1084,8 @@ func (src *VirtualMachine) ConvertTo(dstRaw conversion.Hub) error { // ConvertFrom converts the hub version to this VirtualMachine. func (dst *VirtualMachine) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha2.VirtualMachine) - if err := Convert_v1alpha2_VirtualMachine_To_v1alpha1_VirtualMachine(src, dst, nil); err != nil { + src := srcRaw.(*v1alpha3.VirtualMachine) + if err := Convert_v1alpha3_VirtualMachine_To_v1alpha1_VirtualMachine(src, dst, nil); err != nil { return err } @@ -1089,12 +1095,12 @@ func (dst *VirtualMachine) ConvertFrom(srcRaw conversion.Hub) error { // ConvertTo converts this VirtualMachineList to the Hub version. func (src *VirtualMachineList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha2.VirtualMachineList) - return Convert_v1alpha1_VirtualMachineList_To_v1alpha2_VirtualMachineList(src, dst, nil) + dst := dstRaw.(*v1alpha3.VirtualMachineList) + return Convert_v1alpha1_VirtualMachineList_To_v1alpha3_VirtualMachineList(src, dst, nil) } // ConvertFrom converts the hub version to this VirtualMachineList. func (dst *VirtualMachineList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha2.VirtualMachineList) - return Convert_v1alpha2_VirtualMachineList_To_v1alpha1_VirtualMachineList(src, dst, nil) + src := srcRaw.(*v1alpha3.VirtualMachineList) + return Convert_v1alpha3_VirtualMachineList_To_v1alpha1_VirtualMachineList(src, dst, nil) } diff --git a/api/v1alpha1/virtualmachine_conversion_test.go b/api/v1alpha1/virtualmachine_conversion_test.go index 1a9eac79f..b840556cd 100644 --- a/api/v1alpha1/virtualmachine_conversion_test.go +++ b/api/v1alpha1/virtualmachine_conversion_test.go @@ -19,10 +19,10 @@ import ( "github.com/vmware-tanzu/vm-operator/api/utilconversion" "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - nextver "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - nextver_cloudinit "github.com/vmware-tanzu/vm-operator/api/v1alpha2/cloudinit" - nextver_common "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" - nextver_sysprep "github.com/vmware-tanzu/vm-operator/api/v1alpha2/sysprep" + nextver "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + nextver_cloudinit "github.com/vmware-tanzu/vm-operator/api/v1alpha3/cloudinit" + nextver_common "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" + nextver_sysprep "github.com/vmware-tanzu/vm-operator/api/v1alpha3/sysprep" ) func TestVirtualMachineConversion(t *testing.T) { @@ -83,7 +83,7 @@ func TestVirtualMachineConversion(t *testing.T) { Interfaces: []nextver.VirtualMachineNetworkInterfaceSpec{ { Name: "vds-interface", - Network: nextver_common.PartialObjectRef{ + Network: &nextver_common.PartialObjectRef{ TypeMeta: metav1.TypeMeta{ Kind: "Network", APIVersion: "netoperator.vmware.com/v1alpha1", @@ -94,7 +94,7 @@ func TestVirtualMachineConversion(t *testing.T) { }, { Name: "ncp-interface", - Network: nextver_common.PartialObjectRef{ + Network: &nextver_common.PartialObjectRef{ TypeMeta: metav1.TypeMeta{ Kind: "VirtualNetwork", APIVersion: "vmware.com/v1alpha1", @@ -105,7 +105,7 @@ func TestVirtualMachineConversion(t *testing.T) { }, { Name: "nsx-vpc-subnet-interface", - Network: nextver_common.PartialObjectRef{ + Network: &nextver_common.PartialObjectRef{ TypeMeta: metav1.TypeMeta{ Kind: "Subnet", APIVersion: "nsx.vmware.com/v1alpha1", @@ -116,7 +116,7 @@ func TestVirtualMachineConversion(t *testing.T) { }, { Name: "nsx-vpc-subnetset-interface", - Network: nextver_common.PartialObjectRef{ + Network: &nextver_common.PartialObjectRef{ TypeMeta: metav1.TypeMeta{ Kind: "SubnetSet", APIVersion: "nsx.vmware.com/v1alpha1", @@ -126,7 +126,7 @@ func TestVirtualMachineConversion(t *testing.T) { }, { Name: "my-interface", - Network: nextver_common.PartialObjectRef{ + Network: &nextver_common.PartialObjectRef{ TypeMeta: metav1.TypeMeta{ Kind: "Network", APIVersion: "netoperator.vmware.com/v1alpha1", diff --git a/api/v1alpha1/virtualmachineclass_conversion.go b/api/v1alpha1/virtualmachineclass_conversion.go index c78564707..a57c54a91 100644 --- a/api/v1alpha1/virtualmachineclass_conversion.go +++ b/api/v1alpha1/virtualmachineclass_conversion.go @@ -7,35 +7,35 @@ import ( apiconversion "k8s.io/apimachinery/pkg/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) // ConvertTo converts this VirtualMachineClass to the Hub version. func (src *VirtualMachineClass) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha2.VirtualMachineClass) - return Convert_v1alpha1_VirtualMachineClass_To_v1alpha2_VirtualMachineClass(src, dst, nil) + dst := dstRaw.(*v1alpha3.VirtualMachineClass) + return Convert_v1alpha1_VirtualMachineClass_To_v1alpha3_VirtualMachineClass(src, dst, nil) } // ConvertFrom converts the hub version to this VirtualMachineClass. func (dst *VirtualMachineClass) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha2.VirtualMachineClass) - return Convert_v1alpha2_VirtualMachineClass_To_v1alpha1_VirtualMachineClass(src, dst, nil) + src := srcRaw.(*v1alpha3.VirtualMachineClass) + return Convert_v1alpha3_VirtualMachineClass_To_v1alpha1_VirtualMachineClass(src, dst, nil) } // ConvertTo converts this VirtualMachineClassList to the Hub version. func (src *VirtualMachineClassList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha2.VirtualMachineClassList) - return Convert_v1alpha1_VirtualMachineClassList_To_v1alpha2_VirtualMachineClassList(src, dst, nil) + dst := dstRaw.(*v1alpha3.VirtualMachineClassList) + return Convert_v1alpha1_VirtualMachineClassList_To_v1alpha3_VirtualMachineClassList(src, dst, nil) } // ConvertFrom converts the hub version to this VirtualMachineClassList. func (dst *VirtualMachineClassList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha2.VirtualMachineClassList) - return Convert_v1alpha2_VirtualMachineClassList_To_v1alpha1_VirtualMachineClassList(src, dst, nil) + src := srcRaw.(*v1alpha3.VirtualMachineClassList) + return Convert_v1alpha3_VirtualMachineClassList_To_v1alpha1_VirtualMachineClassList(src, dst, nil) } -func Convert_v1alpha2_VirtualMachineClassStatus_To_v1alpha1_VirtualMachineClassStatus( - in *v1alpha2.VirtualMachineClassStatus, out *VirtualMachineClassStatus, s apiconversion.Scope) error { +func Convert_v1alpha3_VirtualMachineClassStatus_To_v1alpha1_VirtualMachineClassStatus( + in *v1alpha3.VirtualMachineClassStatus, out *VirtualMachineClassStatus, s apiconversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineClassStatus_To_v1alpha1_VirtualMachineClassStatus(in, out, s) + return autoConvert_v1alpha3_VirtualMachineClassStatus_To_v1alpha1_VirtualMachineClassStatus(in, out, s) } diff --git a/api/v1alpha1/virtualmachineimage_conversion.go b/api/v1alpha1/virtualmachineimage_conversion.go index e0f2884fb..1e2aa467e 100644 --- a/api/v1alpha1/virtualmachineimage_conversion.go +++ b/api/v1alpha1/virtualmachineimage_conversion.go @@ -13,33 +13,12 @@ import ( ctrl "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/conversion" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" ) -func Convert_v1alpha1_ContentProviderReference_To_common_LocalObjectRef( - in *ContentProviderReference, out *common.LocalObjectRef, s apiconversion.Scope) error { - - out.APIVersion = in.APIVersion - out.Kind = in.Kind - out.Name = in.Name - - return nil -} - -func Convert_common_LocalObjectRef_To_v1alpha1_ContentProviderReference( - in *common.LocalObjectRef, out *ContentProviderReference, s apiconversion.Scope) error { - - out.APIVersion = in.APIVersion - out.Kind = in.Kind - out.Name = in.Name - // out.Namespace = - - return nil -} - -func Convert_v1alpha2_VirtualMachineImageOSInfo_To_v1alpha1_VirtualMachineImageOSInfo( - in *v1alpha2.VirtualMachineImageOSInfo, out *VirtualMachineImageOSInfo, s apiconversion.Scope) error { +func Convert_v1alpha3_VirtualMachineImageOSInfo_To_v1alpha1_VirtualMachineImageOSInfo( + in *v1alpha3.VirtualMachineImageOSInfo, out *VirtualMachineImageOSInfo, s apiconversion.Scope) error { // = in.ID out.Type = in.Type @@ -48,8 +27,8 @@ func Convert_v1alpha2_VirtualMachineImageOSInfo_To_v1alpha1_VirtualMachineImageO return nil } -func convert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha2_VirtualMachineImageOSInfo( - in *VirtualMachineImageOSInfo, out *v1alpha2.VirtualMachineImageOSInfo, s apiconversion.Scope) error { +func convert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha3_VirtualMachineImageOSInfo( + in *VirtualMachineImageOSInfo, out *v1alpha3.VirtualMachineImageOSInfo, s apiconversion.Scope) error { out.Type = in.Type out.Version = in.Version @@ -57,8 +36,8 @@ func convert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha2_VirtualMachineImageO return nil } -func convert_v1alpha2_VirtualMachineImage_OVFProperties_To_v1alpha1_VirtualMachineImage_OVFEnv( - in []v1alpha2.OVFProperty, out *map[string]OvfProperty, s apiconversion.Scope) error { +func convert_v1alpha3_VirtualMachineImage_OVFProperties_To_v1alpha1_VirtualMachineImage_OVFEnv( + in []v1alpha3.OVFProperty, out *map[string]OvfProperty, s apiconversion.Scope) error { if in != nil { *out = map[string]OvfProperty{} @@ -76,13 +55,13 @@ func convert_v1alpha2_VirtualMachineImage_OVFProperties_To_v1alpha1_VirtualMachi return nil } -func convert_v1alpha1_VirtualMachineImage_OVFEnv_To_v1alpha2_VirtualMachineImage_OVFProperties( - in map[string]OvfProperty, out *[]v1alpha2.OVFProperty, s apiconversion.Scope) error { +func convert_v1alpha1_VirtualMachineImage_OVFEnv_To_v1alpha3_VirtualMachineImage_OVFProperties( + in map[string]OvfProperty, out *[]v1alpha3.OVFProperty, s apiconversion.Scope) error { if in != nil { - *out = make([]v1alpha2.OVFProperty, 0, len(in)) + *out = make([]v1alpha3.OVFProperty, 0, len(in)) for _, v := range in { - *out = append(*out, v1alpha2.OVFProperty{ + *out = append(*out, v1alpha3.OVFProperty{ Key: v.Key, Type: v.Type, Default: v.Default, @@ -93,7 +72,7 @@ func convert_v1alpha1_VirtualMachineImage_OVFEnv_To_v1alpha2_VirtualMachineImage return nil } -func convert_v1alpha2_VirtualMachineImageStatusConditions_To_v1alpha1_VirtualMachineImageStatusConditions( +func convert_v1alpha3_VirtualMachineImageStatusConditions_To_v1alpha1_VirtualMachineImageStatusConditions( conditions []metav1.Condition) []Condition { if len(conditions) == 0 { @@ -107,7 +86,7 @@ func convert_v1alpha2_VirtualMachineImageStatusConditions_To_v1alpha1_VirtualMac for i := range conditions { c := conditions[i] - if c.Type == v1alpha2.ReadyConditionType { + if c.Type == v1alpha3.ReadyConditionType { readyCondition = c break } @@ -132,12 +111,12 @@ func convert_v1alpha2_VirtualMachineImageStatusConditions_To_v1alpha1_VirtualMac } switch readyCondition.Reason { - case v1alpha2.VirtualMachineImageProviderSecurityNotCompliantReason: + case v1alpha3.VirtualMachineImageProviderSecurityNotCompliantReason: securityCompliantCondition = falseConditionWithReason(VirtualMachineImageProviderSecurityComplianceCondition) - case v1alpha2.VirtualMachineImageProviderNotReadyReason: + case v1alpha3.VirtualMachineImageProviderNotReadyReason: securityCompliantCondition = trueCondition(VirtualMachineImageProviderSecurityComplianceCondition) imageProviderReadyCondition = falseConditionWithReason(VirtualMachineImageProviderReadyCondition) - case v1alpha2.VirtualMachineImageNotSyncedReason: + case v1alpha3.VirtualMachineImageNotSyncedReason: securityCompliantCondition = trueCondition(VirtualMachineImageProviderSecurityComplianceCondition) imageProviderReadyCondition = trueCondition(VirtualMachineImageProviderReadyCondition) imageSyncedCondition = falseConditionWithReason(VirtualMachineImageSyncedCondition) @@ -161,7 +140,7 @@ func convert_v1alpha2_VirtualMachineImageStatusConditions_To_v1alpha1_VirtualMac return v1a1Conditions } -func convert_v1alpha1_VirtualMachineImageStatusConditions_To_v1alpha2_VirtualMachineImageStatusConditions( +func convert_v1alpha1_VirtualMachineImageStatusConditions_To_v1alpha3_VirtualMachineImageStatusConditions( conditions []Condition) []metav1.Condition { if len(conditions) == 0 { @@ -175,7 +154,7 @@ func convert_v1alpha1_VirtualMachineImageStatusConditions_To_v1alpha2_VirtualMac latestTransitionTime metav1.Time ) - // Condition types which are folded into the Ready condition in v1alpha2 + // Condition types which are folded into the Ready condition in v1alpha3 oldConditionTypes := map[ConditionType]struct{}{ VirtualMachineImageSyncedCondition: {}, VirtualMachineImageProviderReadyCondition: {}, @@ -185,7 +164,7 @@ func convert_v1alpha1_VirtualMachineImageStatusConditions_To_v1alpha2_VirtualMac for _, condition := range conditions { if _, ok := oldConditionTypes[condition.Type]; ok && condition.Status == corev1.ConditionFalse { readyCondition = &metav1.Condition{ - Type: v1alpha2.ReadyConditionType, + Type: v1alpha3.ReadyConditionType, Status: metav1.ConditionFalse, LastTransitionTime: condition.LastTransitionTime, Reason: condition.Reason, @@ -200,7 +179,7 @@ func convert_v1alpha1_VirtualMachineImageStatusConditions_To_v1alpha2_VirtualMac if readyCondition == nil { readyCondition = &metav1.Condition{ - Type: v1alpha2.ReadyConditionType, + Type: v1alpha3.ReadyConditionType, Status: metav1.ConditionTrue, LastTransitionTime: latestTransitionTime, } @@ -216,8 +195,8 @@ func convert_v1alpha1_VirtualMachineImageStatusConditions_To_v1alpha2_VirtualMac return []metav1.Condition{*readyCondition} } -func Convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSpec( - in *VirtualMachineImageSpec, out *v1alpha2.VirtualMachineImageSpec, s apiconversion.Scope) error { +func Convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageSpec( + in *VirtualMachineImageSpec, out *v1alpha3.VirtualMachineImageSpec, s apiconversion.Scope) error { // in.Type // in.ImageSourceType @@ -227,19 +206,27 @@ func Convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSpe // in.OVFEnv // in.HardwareVersion - return autoConvert_v1alpha1_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSpec(in, out, s) + if in.ProviderRef.APIVersion != "" || in.ProviderRef.Kind != "" || in.ProviderRef.Name != "" { + out.ProviderRef = &common.LocalObjectRef{ + APIVersion: in.ProviderRef.APIVersion, + Kind: in.ProviderRef.Kind, + Name: in.ProviderRef.Name, + } + } + + return autoConvert_v1alpha1_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageSpec(in, out, s) } -func Convert_v1alpha1_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineImageStatus( - in *VirtualMachineImageStatus, out *v1alpha2.VirtualMachineImageStatus, s apiconversion.Scope) error { +func Convert_v1alpha1_VirtualMachineImageStatus_To_v1alpha3_VirtualMachineImageStatus( + in *VirtualMachineImageStatus, out *v1alpha3.VirtualMachineImageStatus, s apiconversion.Scope) error { - if err := autoConvert_v1alpha1_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineImageStatus(in, out, s); err != nil { + if err := autoConvert_v1alpha1_VirtualMachineImageStatus_To_v1alpha3_VirtualMachineImageStatus(in, out, s); err != nil { return err } out.Name = in.ImageName out.ProviderContentVersion = in.ContentVersion - out.Conditions = convert_v1alpha1_VirtualMachineImageStatusConditions_To_v1alpha2_VirtualMachineImageStatusConditions(in.Conditions) + out.Conditions = convert_v1alpha1_VirtualMachineImageStatusConditions_To_v1alpha3_VirtualMachineImageStatusConditions(in.Conditions) // in.ImageSupported // in.ContentLibraryRef @@ -251,10 +238,28 @@ func Convert_v1alpha1_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineImageS return nil } -func Convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageStatus( - in *v1alpha2.VirtualMachineImageStatus, out *VirtualMachineImageStatus, s apiconversion.Scope) error { +func Convert_v1alpha3_VirtualMachineImageSpec_To_v1alpha1_VirtualMachineImageSpec( + in *v1alpha3.VirtualMachineImageSpec, out *VirtualMachineImageSpec, s apiconversion.Scope) error { + + if err := autoConvert_v1alpha3_VirtualMachineImageSpec_To_v1alpha1_VirtualMachineImageSpec(in, out, s); err != nil { + return err + } + + if in.ProviderRef != nil { + out.ProviderRef = ContentProviderReference{ + APIVersion: in.ProviderRef.APIVersion, + Kind: in.ProviderRef.Kind, + Name: in.ProviderRef.Name, + } + } + + return nil +} + +func Convert_v1alpha3_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageStatus( + in *v1alpha3.VirtualMachineImageStatus, out *VirtualMachineImageStatus, s apiconversion.Scope) error { - if err := autoConvert_v1alpha2_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageStatus(in, out, s); err != nil { + if err := autoConvert_v1alpha3_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageStatus(in, out, s); err != nil { return err } @@ -264,7 +269,7 @@ func Convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageS // in.Capabilities - out.Conditions = convert_v1alpha2_VirtualMachineImageStatusConditions_To_v1alpha1_VirtualMachineImageStatusConditions(in.Conditions) + out.Conditions = convert_v1alpha3_VirtualMachineImageStatusConditions_To_v1alpha1_VirtualMachineImageStatusConditions(in.Conditions) // Deprecated: out.Uuid = "" @@ -274,8 +279,8 @@ func Convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageS return nil } -func convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageStatus( - in *VirtualMachineImageSpec, out *v1alpha2.VirtualMachineImageStatus, s apiconversion.Scope) error { +func convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageStatus( + in *VirtualMachineImageSpec, out *v1alpha3.VirtualMachineImageStatus, s apiconversion.Scope) error { // Some fields of the v1a1 ImageSpec moved into the v1a2 ImageStatus. // conversion-gen doesn't handle that so do those here. @@ -285,23 +290,23 @@ func convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSta out.HardwareVersion = &in.HardwareVersion } - if err := convert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha2_VirtualMachineImageOSInfo(&in.OSInfo, &out.OSInfo, s); err != nil { + if err := convert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha3_VirtualMachineImageOSInfo(&in.OSInfo, &out.OSInfo, s); err != nil { return err } - if err := convert_v1alpha1_VirtualMachineImage_OVFEnv_To_v1alpha2_VirtualMachineImage_OVFProperties(in.OVFEnv, &out.OVFProperties, s); err != nil { + if err := convert_v1alpha1_VirtualMachineImage_OVFEnv_To_v1alpha3_VirtualMachineImage_OVFProperties(in.OVFEnv, &out.OVFProperties, s); err != nil { return err } - if err := Convert_v1alpha1_VirtualMachineImageProductInfo_To_v1alpha2_VirtualMachineImageProductInfo(&in.ProductInfo, &out.ProductInfo, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineImageProductInfo_To_v1alpha3_VirtualMachineImageProductInfo(&in.ProductInfo, &out.ProductInfo, s); err != nil { return err } return nil } -func convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageSpec( - in *v1alpha2.VirtualMachineImageStatus, out *VirtualMachineImageSpec, s apiconversion.Scope) error { +func convert_v1alpha3_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageSpec( + in *v1alpha3.VirtualMachineImageStatus, out *VirtualMachineImageSpec, s apiconversion.Scope) error { // Some fields of the v1a1 ImageSpec moved into the v1a2 ImageStatus. // conversion-gen doesn't handle that so do those here. @@ -311,22 +316,22 @@ func convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageS out.HardwareVersion = *in.HardwareVersion } - if err := Convert_v1alpha2_VirtualMachineImageOSInfo_To_v1alpha1_VirtualMachineImageOSInfo(&in.OSInfo, &out.OSInfo, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineImageOSInfo_To_v1alpha1_VirtualMachineImageOSInfo(&in.OSInfo, &out.OSInfo, s); err != nil { return err } - if err := convert_v1alpha2_VirtualMachineImage_OVFProperties_To_v1alpha1_VirtualMachineImage_OVFEnv(in.OVFProperties, &out.OVFEnv, s); err != nil { + if err := convert_v1alpha3_VirtualMachineImage_OVFProperties_To_v1alpha1_VirtualMachineImage_OVFEnv(in.OVFProperties, &out.OVFEnv, s); err != nil { return err } - if err := Convert_v1alpha2_VirtualMachineImageProductInfo_To_v1alpha1_VirtualMachineImageProductInfo(&in.ProductInfo, &out.ProductInfo, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineImageProductInfo_To_v1alpha1_VirtualMachineImageProductInfo(&in.ProductInfo, &out.ProductInfo, s); err != nil { return err } return nil } -func convert_v1alpha2_VirtualMachineImage_VMwareSystemProperties_To_v1alpha1_VirtualMachineImageAnnotations( +func convert_v1alpha3_VirtualMachineImage_VMwareSystemProperties_To_v1alpha1_VirtualMachineImageAnnotations( in *[]common.KeyValuePair, out *map[string]string) error { if in != nil && len(*in) > 0 { @@ -342,7 +347,7 @@ func convert_v1alpha2_VirtualMachineImage_VMwareSystemProperties_To_v1alpha1_Vir return nil } -func convert_v1alpha1_VirtualMachineImageAnnotations_To_v1alpha2_VirtualMachineImage_VMwareSystemProperties( +func convert_v1alpha1_VirtualMachineImageAnnotations_To_v1alpha3_VirtualMachineImage_VMwareSystemProperties( in *map[string]string, dstAnnotations *map[string]string, dstSystemProperties *[]common.KeyValuePair) error { if *in == nil { return nil @@ -372,16 +377,16 @@ func convert_v1alpha1_VirtualMachineImageAnnotations_To_v1alpha2_VirtualMachineI // ConvertTo converts this VirtualMachineImage to the Hub version. func (src *VirtualMachineImage) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha2.VirtualMachineImage) - if err := Convert_v1alpha1_VirtualMachineImage_To_v1alpha2_VirtualMachineImage(src, dst, nil); err != nil { + dst := dstRaw.(*v1alpha3.VirtualMachineImage) + if err := Convert_v1alpha1_VirtualMachineImage_To_v1alpha3_VirtualMachineImage(src, dst, nil); err != nil { return err } - if err := convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageStatus(&src.Spec, &dst.Status, nil); err != nil { + if err := convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageStatus(&src.Spec, &dst.Status, nil); err != nil { return err } - if err := convert_v1alpha1_VirtualMachineImageAnnotations_To_v1alpha2_VirtualMachineImage_VMwareSystemProperties( + if err := convert_v1alpha1_VirtualMachineImageAnnotations_To_v1alpha3_VirtualMachineImage_VMwareSystemProperties( &src.Annotations, &dst.Annotations, &dst.Status.VMwareSystemProperties); err != nil { return err } @@ -391,16 +396,17 @@ func (src *VirtualMachineImage) ConvertTo(dstRaw conversion.Hub) error { // ConvertFrom converts the hub version to this VirtualMachineImage. func (dst *VirtualMachineImage) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha2.VirtualMachineImage) - if err := Convert_v1alpha2_VirtualMachineImage_To_v1alpha1_VirtualMachineImage(src, dst, nil); err != nil { + src := srcRaw.(*v1alpha3.VirtualMachineImage) + + if err := Convert_v1alpha3_VirtualMachineImage_To_v1alpha1_VirtualMachineImage(src, dst, nil); err != nil { return err } - if err := convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageSpec(&src.Status, &dst.Spec, nil); err != nil { + if err := convert_v1alpha3_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageSpec(&src.Status, &dst.Spec, nil); err != nil { return err } - if err := convert_v1alpha2_VirtualMachineImage_VMwareSystemProperties_To_v1alpha1_VirtualMachineImageAnnotations( + if err := convert_v1alpha3_VirtualMachineImage_VMwareSystemProperties_To_v1alpha1_VirtualMachineImageAnnotations( &src.Status.VMwareSystemProperties, &dst.Annotations); err != nil { return err } @@ -417,28 +423,28 @@ func (dst *VirtualMachineImage) ConvertFrom(srcRaw conversion.Hub) error { // ConvertTo converts this VirtualMachineImageList to the Hub version. func (src *VirtualMachineImageList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha2.VirtualMachineImageList) - return Convert_v1alpha1_VirtualMachineImageList_To_v1alpha2_VirtualMachineImageList(src, dst, nil) + dst := dstRaw.(*v1alpha3.VirtualMachineImageList) + return Convert_v1alpha1_VirtualMachineImageList_To_v1alpha3_VirtualMachineImageList(src, dst, nil) } // ConvertFrom converts the hub version to this VirtualMachineImageList. func (dst *VirtualMachineImageList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha2.VirtualMachineImageList) - return Convert_v1alpha2_VirtualMachineImageList_To_v1alpha1_VirtualMachineImageList(src, dst, nil) + src := srcRaw.(*v1alpha3.VirtualMachineImageList) + return Convert_v1alpha3_VirtualMachineImageList_To_v1alpha1_VirtualMachineImageList(src, dst, nil) } // ConvertTo converts this ClusterVirtualMachineImage to the Hub version. func (src *ClusterVirtualMachineImage) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha2.ClusterVirtualMachineImage) - if err := Convert_v1alpha1_ClusterVirtualMachineImage_To_v1alpha2_ClusterVirtualMachineImage(src, dst, nil); err != nil { + dst := dstRaw.(*v1alpha3.ClusterVirtualMachineImage) + if err := Convert_v1alpha1_ClusterVirtualMachineImage_To_v1alpha3_ClusterVirtualMachineImage(src, dst, nil); err != nil { return err } - if err := convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageStatus(&src.Spec, &dst.Status, nil); err != nil { + if err := convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageStatus(&src.Spec, &dst.Status, nil); err != nil { return err } - if err := convert_v1alpha1_VirtualMachineImageAnnotations_To_v1alpha2_VirtualMachineImage_VMwareSystemProperties( + if err := convert_v1alpha1_VirtualMachineImageAnnotations_To_v1alpha3_VirtualMachineImage_VMwareSystemProperties( &src.Annotations, &dst.Annotations, &dst.Status.VMwareSystemProperties); err != nil { return err } @@ -448,16 +454,16 @@ func (src *ClusterVirtualMachineImage) ConvertTo(dstRaw conversion.Hub) error { // ConvertFrom converts the hub version to this ClusterVirtualMachineImage. func (dst *ClusterVirtualMachineImage) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha2.ClusterVirtualMachineImage) - if err := Convert_v1alpha2_ClusterVirtualMachineImage_To_v1alpha1_ClusterVirtualMachineImage(src, dst, nil); err != nil { + src := srcRaw.(*v1alpha3.ClusterVirtualMachineImage) + if err := Convert_v1alpha3_ClusterVirtualMachineImage_To_v1alpha1_ClusterVirtualMachineImage(src, dst, nil); err != nil { return err } - if err := convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageSpec(&src.Status, &dst.Spec, nil); err != nil { + if err := convert_v1alpha3_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageSpec(&src.Status, &dst.Spec, nil); err != nil { return err } - if err := convert_v1alpha2_VirtualMachineImage_VMwareSystemProperties_To_v1alpha1_VirtualMachineImageAnnotations( + if err := convert_v1alpha3_VirtualMachineImage_VMwareSystemProperties_To_v1alpha1_VirtualMachineImageAnnotations( &src.Status.VMwareSystemProperties, &dst.Annotations); err != nil { return err } @@ -468,7 +474,7 @@ func (dst *ClusterVirtualMachineImage) ConvertFrom(srcRaw conversion.Hub) error } func readContentLibRefConversionAnnotation(from ctrl.Object) (objRef *corev1.TypedLocalObjectReference) { - if data, ok := from.GetAnnotations()[v1alpha2.VMIContentLibRefAnnotation]; ok { + if data, ok := from.GetAnnotations()[v1alpha3.VMIContentLibRefAnnotation]; ok { objRef = &corev1.TypedLocalObjectReference{} _ = json.Unmarshal([]byte(data), objRef) } @@ -477,12 +483,12 @@ func readContentLibRefConversionAnnotation(from ctrl.Object) (objRef *corev1.Typ // ConvertTo converts this ClusterVirtualMachineImageList to the Hub version. func (src *ClusterVirtualMachineImageList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha2.ClusterVirtualMachineImageList) - return Convert_v1alpha1_ClusterVirtualMachineImageList_To_v1alpha2_ClusterVirtualMachineImageList(src, dst, nil) + dst := dstRaw.(*v1alpha3.ClusterVirtualMachineImageList) + return Convert_v1alpha1_ClusterVirtualMachineImageList_To_v1alpha3_ClusterVirtualMachineImageList(src, dst, nil) } // ConvertFrom converts the hub version to this ClusterVirtualMachineImageList. func (dst *ClusterVirtualMachineImageList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha2.ClusterVirtualMachineImageList) - return Convert_v1alpha2_ClusterVirtualMachineImageList_To_v1alpha1_ClusterVirtualMachineImageList(src, dst, nil) + src := srcRaw.(*v1alpha3.ClusterVirtualMachineImageList) + return Convert_v1alpha3_ClusterVirtualMachineImageList_To_v1alpha1_ClusterVirtualMachineImageList(src, dst, nil) } diff --git a/api/v1alpha1/virtualmachineimage_conversion_test.go b/api/v1alpha1/virtualmachineimage_conversion_test.go index f7cb07a9e..e707054a4 100644 --- a/api/v1alpha1/virtualmachineimage_conversion_test.go +++ b/api/v1alpha1/virtualmachineimage_conversion_test.go @@ -15,8 +15,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - nextver "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - nextver_common "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + nextver "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + nextver_common "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" ) func TestVirtualMachineImageConversion(t *testing.T) { @@ -32,7 +32,7 @@ func TestVirtualMachineImageConversion(t *testing.T) { }, }, Spec: nextver.VirtualMachineImageSpec{ - ProviderRef: nextver_common.LocalObjectRef{ + ProviderRef: &nextver_common.LocalObjectRef{ APIVersion: "vmware.com/v1", Kind: "ImageProvider", Name: "my-image", diff --git a/api/v1alpha1/virtualmachinepublishrequest_conversion.go b/api/v1alpha1/virtualmachinepublishrequest_conversion.go index 5257f1849..c2b64a757 100644 --- a/api/v1alpha1/virtualmachinepublishrequest_conversion.go +++ b/api/v1alpha1/virtualmachinepublishrequest_conversion.go @@ -4,30 +4,30 @@ package v1alpha1 import ( - "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "sigs.k8s.io/controller-runtime/pkg/conversion" ) // ConvertTo converts this VirtualMachinePublishRequest to the Hub version. func (src *VirtualMachinePublishRequest) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha2.VirtualMachinePublishRequest) - return Convert_v1alpha1_VirtualMachinePublishRequest_To_v1alpha2_VirtualMachinePublishRequest(src, dst, nil) + dst := dstRaw.(*v1alpha3.VirtualMachinePublishRequest) + return Convert_v1alpha1_VirtualMachinePublishRequest_To_v1alpha3_VirtualMachinePublishRequest(src, dst, nil) } // ConvertFrom converts the hub version to this VirtualMachinePublishRequest. func (dst *VirtualMachinePublishRequest) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha2.VirtualMachinePublishRequest) - return Convert_v1alpha2_VirtualMachinePublishRequest_To_v1alpha1_VirtualMachinePublishRequest(src, dst, nil) + src := srcRaw.(*v1alpha3.VirtualMachinePublishRequest) + return Convert_v1alpha3_VirtualMachinePublishRequest_To_v1alpha1_VirtualMachinePublishRequest(src, dst, nil) } // ConvertTo converts this VirtualMachinePublishRequestList to the Hub version. func (src *VirtualMachinePublishRequestList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha2.VirtualMachinePublishRequestList) - return Convert_v1alpha1_VirtualMachinePublishRequestList_To_v1alpha2_VirtualMachinePublishRequestList(src, dst, nil) + dst := dstRaw.(*v1alpha3.VirtualMachinePublishRequestList) + return Convert_v1alpha1_VirtualMachinePublishRequestList_To_v1alpha3_VirtualMachinePublishRequestList(src, dst, nil) } // ConvertFrom converts the hub version to this VirtualMachinePublishRequestList. func (dst *VirtualMachinePublishRequestList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha2.VirtualMachinePublishRequestList) - return Convert_v1alpha2_VirtualMachinePublishRequestList_To_v1alpha1_VirtualMachinePublishRequestList(src, dst, nil) + src := srcRaw.(*v1alpha3.VirtualMachinePublishRequestList) + return Convert_v1alpha3_VirtualMachinePublishRequestList_To_v1alpha1_VirtualMachinePublishRequestList(src, dst, nil) } diff --git a/api/v1alpha1/virtualmachineservice_conversion.go b/api/v1alpha1/virtualmachineservice_conversion.go index 8f9253f5a..0fc6f7e2f 100644 --- a/api/v1alpha1/virtualmachineservice_conversion.go +++ b/api/v1alpha1/virtualmachineservice_conversion.go @@ -4,30 +4,30 @@ package v1alpha1 import ( - "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "sigs.k8s.io/controller-runtime/pkg/conversion" ) // ConvertTo converts this VirtualMachineService to the Hub version. func (src *VirtualMachineService) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha2.VirtualMachineService) - return Convert_v1alpha1_VirtualMachineService_To_v1alpha2_VirtualMachineService(src, dst, nil) + dst := dstRaw.(*v1alpha3.VirtualMachineService) + return Convert_v1alpha1_VirtualMachineService_To_v1alpha3_VirtualMachineService(src, dst, nil) } // ConvertFrom converts the hub version to this VirtualMachineService. func (dst *VirtualMachineService) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha2.VirtualMachineService) - return Convert_v1alpha2_VirtualMachineService_To_v1alpha1_VirtualMachineService(src, dst, nil) + src := srcRaw.(*v1alpha3.VirtualMachineService) + return Convert_v1alpha3_VirtualMachineService_To_v1alpha1_VirtualMachineService(src, dst, nil) } // ConvertTo converts this VirtualMachineServiceList to the Hub version. func (src *VirtualMachineServiceList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha2.VirtualMachineServiceList) - return Convert_v1alpha1_VirtualMachineServiceList_To_v1alpha2_VirtualMachineServiceList(src, dst, nil) + dst := dstRaw.(*v1alpha3.VirtualMachineServiceList) + return Convert_v1alpha1_VirtualMachineServiceList_To_v1alpha3_VirtualMachineServiceList(src, dst, nil) } // ConvertFrom converts the hub version to this VirtualMachineServiceList. func (dst *VirtualMachineServiceList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha2.VirtualMachineServiceList) - return Convert_v1alpha2_VirtualMachineServiceList_To_v1alpha1_VirtualMachineServiceList(src, dst, nil) + src := srcRaw.(*v1alpha3.VirtualMachineServiceList) + return Convert_v1alpha3_VirtualMachineServiceList_To_v1alpha1_VirtualMachineServiceList(src, dst, nil) } diff --git a/api/v1alpha1/virtualmachinesetresourcepolicy_conversion.go b/api/v1alpha1/virtualmachinesetresourcepolicy_conversion.go index 100353651..18434f70d 100644 --- a/api/v1alpha1/virtualmachinesetresourcepolicy_conversion.go +++ b/api/v1alpha1/virtualmachinesetresourcepolicy_conversion.go @@ -7,51 +7,51 @@ import ( apiconversion "k8s.io/apimachinery/pkg/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) -func Convert_v1alpha1_VirtualMachineSetResourcePolicySpec_To_v1alpha2_VirtualMachineSetResourcePolicySpec( - in *VirtualMachineSetResourcePolicySpec, out *v1alpha2.VirtualMachineSetResourcePolicySpec, s apiconversion.Scope) error { +func Convert_v1alpha1_VirtualMachineSetResourcePolicySpec_To_v1alpha3_VirtualMachineSetResourcePolicySpec( + in *VirtualMachineSetResourcePolicySpec, out *v1alpha3.VirtualMachineSetResourcePolicySpec, s apiconversion.Scope) error { out.Folder = in.Folder.Name for _, mod := range in.ClusterModules { out.ClusterModuleGroups = append(out.ClusterModuleGroups, mod.GroupName) } - return autoConvert_v1alpha1_VirtualMachineSetResourcePolicySpec_To_v1alpha2_VirtualMachineSetResourcePolicySpec(in, out, s) + return autoConvert_v1alpha1_VirtualMachineSetResourcePolicySpec_To_v1alpha3_VirtualMachineSetResourcePolicySpec(in, out, s) } -func Convert_v1alpha2_VirtualMachineSetResourcePolicySpec_To_v1alpha1_VirtualMachineSetResourcePolicySpec( - in *v1alpha2.VirtualMachineSetResourcePolicySpec, out *VirtualMachineSetResourcePolicySpec, s apiconversion.Scope) error { +func Convert_v1alpha3_VirtualMachineSetResourcePolicySpec_To_v1alpha1_VirtualMachineSetResourcePolicySpec( + in *v1alpha3.VirtualMachineSetResourcePolicySpec, out *VirtualMachineSetResourcePolicySpec, s apiconversion.Scope) error { out.Folder.Name = in.Folder for _, name := range in.ClusterModuleGroups { out.ClusterModules = append(out.ClusterModules, ClusterModuleSpec{GroupName: name}) } - return autoConvert_v1alpha2_VirtualMachineSetResourcePolicySpec_To_v1alpha1_VirtualMachineSetResourcePolicySpec(in, out, s) + return autoConvert_v1alpha3_VirtualMachineSetResourcePolicySpec_To_v1alpha1_VirtualMachineSetResourcePolicySpec(in, out, s) } // ConvertTo converts this VirtualMachineSetResourcePolicy to the Hub version. func (src *VirtualMachineSetResourcePolicy) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha2.VirtualMachineSetResourcePolicy) - return Convert_v1alpha1_VirtualMachineSetResourcePolicy_To_v1alpha2_VirtualMachineSetResourcePolicy(src, dst, nil) + dst := dstRaw.(*v1alpha3.VirtualMachineSetResourcePolicy) + return Convert_v1alpha1_VirtualMachineSetResourcePolicy_To_v1alpha3_VirtualMachineSetResourcePolicy(src, dst, nil) } // ConvertFrom converts the hub version to this VirtualMachineSetResourcePolicy. func (dst *VirtualMachineSetResourcePolicy) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha2.VirtualMachineSetResourcePolicy) - return Convert_v1alpha2_VirtualMachineSetResourcePolicy_To_v1alpha1_VirtualMachineSetResourcePolicy(src, dst, nil) + src := srcRaw.(*v1alpha3.VirtualMachineSetResourcePolicy) + return Convert_v1alpha3_VirtualMachineSetResourcePolicy_To_v1alpha1_VirtualMachineSetResourcePolicy(src, dst, nil) } // ConvertTo converts this VirtualMachineSetResourcePolicyList to the Hub version. func (src *VirtualMachineSetResourcePolicyList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha2.VirtualMachineSetResourcePolicyList) - return Convert_v1alpha1_VirtualMachineSetResourcePolicyList_To_v1alpha2_VirtualMachineSetResourcePolicyList(src, dst, nil) + dst := dstRaw.(*v1alpha3.VirtualMachineSetResourcePolicyList) + return Convert_v1alpha1_VirtualMachineSetResourcePolicyList_To_v1alpha3_VirtualMachineSetResourcePolicyList(src, dst, nil) } // ConvertFrom converts the hub version to this VirtualMachineSetResourcePolicyList. func (dst *VirtualMachineSetResourcePolicyList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha2.VirtualMachineSetResourcePolicyList) - return Convert_v1alpha2_VirtualMachineSetResourcePolicyList_To_v1alpha1_VirtualMachineSetResourcePolicyList(src, dst, nil) + src := srcRaw.(*v1alpha3.VirtualMachineSetResourcePolicyList) + return Convert_v1alpha3_VirtualMachineSetResourcePolicyList_To_v1alpha1_VirtualMachineSetResourcePolicyList(src, dst, nil) } diff --git a/api/v1alpha1/zz_generated.conversion.go b/api/v1alpha1/zz_generated.conversion.go index 4f3b90c73..7849e2248 100644 --- a/api/v1alpha1/zz_generated.conversion.go +++ b/api/v1alpha1/zz_generated.conversion.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated // +build !ignore_autogenerated -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // Code generated by conversion-gen. DO NOT EDIT. @@ -12,8 +12,7 @@ import ( json "encoding/json" unsafe "unsafe" - v1alpha2 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - common "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + v1alpha3 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" @@ -27,473 +26,463 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*ClusterVirtualMachineImage)(nil), (*v1alpha2.ClusterVirtualMachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterVirtualMachineImage_To_v1alpha2_ClusterVirtualMachineImage(a.(*ClusterVirtualMachineImage), b.(*v1alpha2.ClusterVirtualMachineImage), scope) + if err := s.AddGeneratedConversionFunc((*ClusterVirtualMachineImage)(nil), (*v1alpha3.ClusterVirtualMachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_ClusterVirtualMachineImage_To_v1alpha3_ClusterVirtualMachineImage(a.(*ClusterVirtualMachineImage), b.(*v1alpha3.ClusterVirtualMachineImage), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ClusterVirtualMachineImage)(nil), (*ClusterVirtualMachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ClusterVirtualMachineImage_To_v1alpha1_ClusterVirtualMachineImage(a.(*v1alpha2.ClusterVirtualMachineImage), b.(*ClusterVirtualMachineImage), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.ClusterVirtualMachineImage)(nil), (*ClusterVirtualMachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterVirtualMachineImage_To_v1alpha1_ClusterVirtualMachineImage(a.(*v1alpha3.ClusterVirtualMachineImage), b.(*ClusterVirtualMachineImage), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ClusterVirtualMachineImageList)(nil), (*v1alpha2.ClusterVirtualMachineImageList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterVirtualMachineImageList_To_v1alpha2_ClusterVirtualMachineImageList(a.(*ClusterVirtualMachineImageList), b.(*v1alpha2.ClusterVirtualMachineImageList), scope) + if err := s.AddGeneratedConversionFunc((*ClusterVirtualMachineImageList)(nil), (*v1alpha3.ClusterVirtualMachineImageList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_ClusterVirtualMachineImageList_To_v1alpha3_ClusterVirtualMachineImageList(a.(*ClusterVirtualMachineImageList), b.(*v1alpha3.ClusterVirtualMachineImageList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ClusterVirtualMachineImageList)(nil), (*ClusterVirtualMachineImageList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ClusterVirtualMachineImageList_To_v1alpha1_ClusterVirtualMachineImageList(a.(*v1alpha2.ClusterVirtualMachineImageList), b.(*ClusterVirtualMachineImageList), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.ClusterVirtualMachineImageList)(nil), (*ClusterVirtualMachineImageList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterVirtualMachineImageList_To_v1alpha1_ClusterVirtualMachineImageList(a.(*v1alpha3.ClusterVirtualMachineImageList), b.(*ClusterVirtualMachineImageList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*DynamicDirectPathIODevice)(nil), (*v1alpha2.DynamicDirectPathIODevice)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_DynamicDirectPathIODevice_To_v1alpha2_DynamicDirectPathIODevice(a.(*DynamicDirectPathIODevice), b.(*v1alpha2.DynamicDirectPathIODevice), scope) + if err := s.AddGeneratedConversionFunc((*DynamicDirectPathIODevice)(nil), (*v1alpha3.DynamicDirectPathIODevice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_DynamicDirectPathIODevice_To_v1alpha3_DynamicDirectPathIODevice(a.(*DynamicDirectPathIODevice), b.(*v1alpha3.DynamicDirectPathIODevice), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.DynamicDirectPathIODevice)(nil), (*DynamicDirectPathIODevice)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_DynamicDirectPathIODevice_To_v1alpha1_DynamicDirectPathIODevice(a.(*v1alpha2.DynamicDirectPathIODevice), b.(*DynamicDirectPathIODevice), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.DynamicDirectPathIODevice)(nil), (*DynamicDirectPathIODevice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DynamicDirectPathIODevice_To_v1alpha1_DynamicDirectPathIODevice(a.(*v1alpha3.DynamicDirectPathIODevice), b.(*DynamicDirectPathIODevice), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*GuestHeartbeatAction)(nil), (*v1alpha2.GuestHeartbeatAction)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_GuestHeartbeatAction_To_v1alpha2_GuestHeartbeatAction(a.(*GuestHeartbeatAction), b.(*v1alpha2.GuestHeartbeatAction), scope) + if err := s.AddGeneratedConversionFunc((*GuestHeartbeatAction)(nil), (*v1alpha3.GuestHeartbeatAction)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_GuestHeartbeatAction_To_v1alpha3_GuestHeartbeatAction(a.(*GuestHeartbeatAction), b.(*v1alpha3.GuestHeartbeatAction), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.GuestHeartbeatAction)(nil), (*GuestHeartbeatAction)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_GuestHeartbeatAction_To_v1alpha1_GuestHeartbeatAction(a.(*v1alpha2.GuestHeartbeatAction), b.(*GuestHeartbeatAction), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.GuestHeartbeatAction)(nil), (*GuestHeartbeatAction)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_GuestHeartbeatAction_To_v1alpha1_GuestHeartbeatAction(a.(*v1alpha3.GuestHeartbeatAction), b.(*GuestHeartbeatAction), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*InstanceStorage)(nil), (*v1alpha2.InstanceStorage)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_InstanceStorage_To_v1alpha2_InstanceStorage(a.(*InstanceStorage), b.(*v1alpha2.InstanceStorage), scope) + if err := s.AddGeneratedConversionFunc((*InstanceStorage)(nil), (*v1alpha3.InstanceStorage)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_InstanceStorage_To_v1alpha3_InstanceStorage(a.(*InstanceStorage), b.(*v1alpha3.InstanceStorage), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.InstanceStorage)(nil), (*InstanceStorage)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_InstanceStorage_To_v1alpha1_InstanceStorage(a.(*v1alpha2.InstanceStorage), b.(*InstanceStorage), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.InstanceStorage)(nil), (*InstanceStorage)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_InstanceStorage_To_v1alpha1_InstanceStorage(a.(*v1alpha3.InstanceStorage), b.(*InstanceStorage), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*InstanceStorageVolume)(nil), (*v1alpha2.InstanceStorageVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_InstanceStorageVolume_To_v1alpha2_InstanceStorageVolume(a.(*InstanceStorageVolume), b.(*v1alpha2.InstanceStorageVolume), scope) + if err := s.AddGeneratedConversionFunc((*InstanceStorageVolume)(nil), (*v1alpha3.InstanceStorageVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_InstanceStorageVolume_To_v1alpha3_InstanceStorageVolume(a.(*InstanceStorageVolume), b.(*v1alpha3.InstanceStorageVolume), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.InstanceStorageVolume)(nil), (*InstanceStorageVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_InstanceStorageVolume_To_v1alpha1_InstanceStorageVolume(a.(*v1alpha2.InstanceStorageVolume), b.(*InstanceStorageVolume), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.InstanceStorageVolume)(nil), (*InstanceStorageVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_InstanceStorageVolume_To_v1alpha1_InstanceStorageVolume(a.(*v1alpha3.InstanceStorageVolume), b.(*InstanceStorageVolume), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*InstanceVolumeClaimVolumeSource)(nil), (*v1alpha2.InstanceVolumeClaimVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_InstanceVolumeClaimVolumeSource_To_v1alpha2_InstanceVolumeClaimVolumeSource(a.(*InstanceVolumeClaimVolumeSource), b.(*v1alpha2.InstanceVolumeClaimVolumeSource), scope) + if err := s.AddGeneratedConversionFunc((*InstanceVolumeClaimVolumeSource)(nil), (*v1alpha3.InstanceVolumeClaimVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_InstanceVolumeClaimVolumeSource_To_v1alpha3_InstanceVolumeClaimVolumeSource(a.(*InstanceVolumeClaimVolumeSource), b.(*v1alpha3.InstanceVolumeClaimVolumeSource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.InstanceVolumeClaimVolumeSource)(nil), (*InstanceVolumeClaimVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_InstanceVolumeClaimVolumeSource_To_v1alpha1_InstanceVolumeClaimVolumeSource(a.(*v1alpha2.InstanceVolumeClaimVolumeSource), b.(*InstanceVolumeClaimVolumeSource), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.InstanceVolumeClaimVolumeSource)(nil), (*InstanceVolumeClaimVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_InstanceVolumeClaimVolumeSource_To_v1alpha1_InstanceVolumeClaimVolumeSource(a.(*v1alpha3.InstanceVolumeClaimVolumeSource), b.(*InstanceVolumeClaimVolumeSource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*LoadBalancerIngress)(nil), (*v1alpha2.LoadBalancerIngress)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_LoadBalancerIngress_To_v1alpha2_LoadBalancerIngress(a.(*LoadBalancerIngress), b.(*v1alpha2.LoadBalancerIngress), scope) + if err := s.AddGeneratedConversionFunc((*LoadBalancerIngress)(nil), (*v1alpha3.LoadBalancerIngress)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_LoadBalancerIngress_To_v1alpha3_LoadBalancerIngress(a.(*LoadBalancerIngress), b.(*v1alpha3.LoadBalancerIngress), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.LoadBalancerIngress)(nil), (*LoadBalancerIngress)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_LoadBalancerIngress_To_v1alpha1_LoadBalancerIngress(a.(*v1alpha2.LoadBalancerIngress), b.(*LoadBalancerIngress), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.LoadBalancerIngress)(nil), (*LoadBalancerIngress)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_LoadBalancerIngress_To_v1alpha1_LoadBalancerIngress(a.(*v1alpha3.LoadBalancerIngress), b.(*LoadBalancerIngress), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*LoadBalancerStatus)(nil), (*v1alpha2.LoadBalancerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_LoadBalancerStatus_To_v1alpha2_LoadBalancerStatus(a.(*LoadBalancerStatus), b.(*v1alpha2.LoadBalancerStatus), scope) + if err := s.AddGeneratedConversionFunc((*LoadBalancerStatus)(nil), (*v1alpha3.LoadBalancerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_LoadBalancerStatus_To_v1alpha3_LoadBalancerStatus(a.(*LoadBalancerStatus), b.(*v1alpha3.LoadBalancerStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.LoadBalancerStatus)(nil), (*LoadBalancerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_LoadBalancerStatus_To_v1alpha1_LoadBalancerStatus(a.(*v1alpha2.LoadBalancerStatus), b.(*LoadBalancerStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.LoadBalancerStatus)(nil), (*LoadBalancerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_LoadBalancerStatus_To_v1alpha1_LoadBalancerStatus(a.(*v1alpha3.LoadBalancerStatus), b.(*LoadBalancerStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*NetworkDeviceStatus)(nil), (*v1alpha2.NetworkDeviceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_NetworkDeviceStatus_To_v1alpha2_NetworkDeviceStatus(a.(*NetworkDeviceStatus), b.(*v1alpha2.NetworkDeviceStatus), scope) + if err := s.AddGeneratedConversionFunc((*NetworkDeviceStatus)(nil), (*v1alpha3.NetworkDeviceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_NetworkDeviceStatus_To_v1alpha3_NetworkDeviceStatus(a.(*NetworkDeviceStatus), b.(*v1alpha3.NetworkDeviceStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.NetworkDeviceStatus)(nil), (*NetworkDeviceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_NetworkDeviceStatus_To_v1alpha1_NetworkDeviceStatus(a.(*v1alpha2.NetworkDeviceStatus), b.(*NetworkDeviceStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.NetworkDeviceStatus)(nil), (*NetworkDeviceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_NetworkDeviceStatus_To_v1alpha1_NetworkDeviceStatus(a.(*v1alpha3.NetworkDeviceStatus), b.(*NetworkDeviceStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*NetworkStatus)(nil), (*v1alpha2.NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_NetworkStatus_To_v1alpha2_NetworkStatus(a.(*NetworkStatus), b.(*v1alpha2.NetworkStatus), scope) + if err := s.AddGeneratedConversionFunc((*NetworkStatus)(nil), (*v1alpha3.NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_NetworkStatus_To_v1alpha3_NetworkStatus(a.(*NetworkStatus), b.(*v1alpha3.NetworkStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.NetworkStatus)(nil), (*NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_NetworkStatus_To_v1alpha1_NetworkStatus(a.(*v1alpha2.NetworkStatus), b.(*NetworkStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.NetworkStatus)(nil), (*NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_NetworkStatus_To_v1alpha1_NetworkStatus(a.(*v1alpha3.NetworkStatus), b.(*NetworkStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*PersistentVolumeClaimVolumeSource)(nil), (*v1alpha2.PersistentVolumeClaimVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_PersistentVolumeClaimVolumeSource_To_v1alpha2_PersistentVolumeClaimVolumeSource(a.(*PersistentVolumeClaimVolumeSource), b.(*v1alpha2.PersistentVolumeClaimVolumeSource), scope) + if err := s.AddGeneratedConversionFunc((*PersistentVolumeClaimVolumeSource)(nil), (*v1alpha3.PersistentVolumeClaimVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_PersistentVolumeClaimVolumeSource_To_v1alpha3_PersistentVolumeClaimVolumeSource(a.(*PersistentVolumeClaimVolumeSource), b.(*v1alpha3.PersistentVolumeClaimVolumeSource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.PersistentVolumeClaimVolumeSource)(nil), (*PersistentVolumeClaimVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_PersistentVolumeClaimVolumeSource_To_v1alpha1_PersistentVolumeClaimVolumeSource(a.(*v1alpha2.PersistentVolumeClaimVolumeSource), b.(*PersistentVolumeClaimVolumeSource), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.PersistentVolumeClaimVolumeSource)(nil), (*PersistentVolumeClaimVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_PersistentVolumeClaimVolumeSource_To_v1alpha1_PersistentVolumeClaimVolumeSource(a.(*v1alpha3.PersistentVolumeClaimVolumeSource), b.(*PersistentVolumeClaimVolumeSource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ResourcePoolSpec)(nil), (*v1alpha2.ResourcePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ResourcePoolSpec_To_v1alpha2_ResourcePoolSpec(a.(*ResourcePoolSpec), b.(*v1alpha2.ResourcePoolSpec), scope) + if err := s.AddGeneratedConversionFunc((*ResourcePoolSpec)(nil), (*v1alpha3.ResourcePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_ResourcePoolSpec_To_v1alpha3_ResourcePoolSpec(a.(*ResourcePoolSpec), b.(*v1alpha3.ResourcePoolSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourcePoolSpec)(nil), (*ResourcePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourcePoolSpec_To_v1alpha1_ResourcePoolSpec(a.(*v1alpha2.ResourcePoolSpec), b.(*ResourcePoolSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourcePoolSpec)(nil), (*ResourcePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourcePoolSpec_To_v1alpha1_ResourcePoolSpec(a.(*v1alpha3.ResourcePoolSpec), b.(*ResourcePoolSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*TCPSocketAction)(nil), (*v1alpha2.TCPSocketAction)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_TCPSocketAction_To_v1alpha2_TCPSocketAction(a.(*TCPSocketAction), b.(*v1alpha2.TCPSocketAction), scope) + if err := s.AddGeneratedConversionFunc((*TCPSocketAction)(nil), (*v1alpha3.TCPSocketAction)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_TCPSocketAction_To_v1alpha3_TCPSocketAction(a.(*TCPSocketAction), b.(*v1alpha3.TCPSocketAction), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.TCPSocketAction)(nil), (*TCPSocketAction)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_TCPSocketAction_To_v1alpha1_TCPSocketAction(a.(*v1alpha2.TCPSocketAction), b.(*TCPSocketAction), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.TCPSocketAction)(nil), (*TCPSocketAction)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_TCPSocketAction_To_v1alpha1_TCPSocketAction(a.(*v1alpha3.TCPSocketAction), b.(*TCPSocketAction), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VGPUDevice)(nil), (*v1alpha2.VGPUDevice)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VGPUDevice_To_v1alpha2_VGPUDevice(a.(*VGPUDevice), b.(*v1alpha2.VGPUDevice), scope) + if err := s.AddGeneratedConversionFunc((*VGPUDevice)(nil), (*v1alpha3.VGPUDevice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VGPUDevice_To_v1alpha3_VGPUDevice(a.(*VGPUDevice), b.(*v1alpha3.VGPUDevice), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VGPUDevice)(nil), (*VGPUDevice)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VGPUDevice_To_v1alpha1_VGPUDevice(a.(*v1alpha2.VGPUDevice), b.(*VGPUDevice), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VGPUDevice)(nil), (*VGPUDevice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VGPUDevice_To_v1alpha1_VGPUDevice(a.(*v1alpha3.VGPUDevice), b.(*VGPUDevice), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualDevices)(nil), (*v1alpha2.VirtualDevices)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualDevices_To_v1alpha2_VirtualDevices(a.(*VirtualDevices), b.(*v1alpha2.VirtualDevices), scope) + if err := s.AddGeneratedConversionFunc((*VirtualDevices)(nil), (*v1alpha3.VirtualDevices)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualDevices_To_v1alpha3_VirtualDevices(a.(*VirtualDevices), b.(*v1alpha3.VirtualDevices), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualDevices)(nil), (*VirtualDevices)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualDevices_To_v1alpha1_VirtualDevices(a.(*v1alpha2.VirtualDevices), b.(*VirtualDevices), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualDevices)(nil), (*VirtualDevices)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualDevices_To_v1alpha1_VirtualDevices(a.(*v1alpha3.VirtualDevices), b.(*VirtualDevices), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachine)(nil), (*v1alpha2.VirtualMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachine_To_v1alpha2_VirtualMachine(a.(*VirtualMachine), b.(*v1alpha2.VirtualMachine), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachine)(nil), (*v1alpha3.VirtualMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachine_To_v1alpha3_VirtualMachine(a.(*VirtualMachine), b.(*v1alpha3.VirtualMachine), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachine)(nil), (*VirtualMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachine_To_v1alpha1_VirtualMachine(a.(*v1alpha2.VirtualMachine), b.(*VirtualMachine), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachine)(nil), (*VirtualMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachine_To_v1alpha1_VirtualMachine(a.(*v1alpha3.VirtualMachine), b.(*VirtualMachine), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineClass)(nil), (*v1alpha2.VirtualMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineClass_To_v1alpha2_VirtualMachineClass(a.(*VirtualMachineClass), b.(*v1alpha2.VirtualMachineClass), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineClass)(nil), (*v1alpha3.VirtualMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineClass_To_v1alpha3_VirtualMachineClass(a.(*VirtualMachineClass), b.(*v1alpha3.VirtualMachineClass), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineClass)(nil), (*VirtualMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineClass_To_v1alpha1_VirtualMachineClass(a.(*v1alpha2.VirtualMachineClass), b.(*VirtualMachineClass), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineClass)(nil), (*VirtualMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineClass_To_v1alpha1_VirtualMachineClass(a.(*v1alpha3.VirtualMachineClass), b.(*VirtualMachineClass), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineClassHardware)(nil), (*v1alpha2.VirtualMachineClassHardware)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineClassHardware_To_v1alpha2_VirtualMachineClassHardware(a.(*VirtualMachineClassHardware), b.(*v1alpha2.VirtualMachineClassHardware), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineClassHardware)(nil), (*v1alpha3.VirtualMachineClassHardware)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineClassHardware_To_v1alpha3_VirtualMachineClassHardware(a.(*VirtualMachineClassHardware), b.(*v1alpha3.VirtualMachineClassHardware), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineClassHardware)(nil), (*VirtualMachineClassHardware)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineClassHardware_To_v1alpha1_VirtualMachineClassHardware(a.(*v1alpha2.VirtualMachineClassHardware), b.(*VirtualMachineClassHardware), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineClassHardware)(nil), (*VirtualMachineClassHardware)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineClassHardware_To_v1alpha1_VirtualMachineClassHardware(a.(*v1alpha3.VirtualMachineClassHardware), b.(*VirtualMachineClassHardware), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineClassList)(nil), (*v1alpha2.VirtualMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineClassList_To_v1alpha2_VirtualMachineClassList(a.(*VirtualMachineClassList), b.(*v1alpha2.VirtualMachineClassList), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineClassList)(nil), (*v1alpha3.VirtualMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineClassList_To_v1alpha3_VirtualMachineClassList(a.(*VirtualMachineClassList), b.(*v1alpha3.VirtualMachineClassList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineClassList)(nil), (*VirtualMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineClassList_To_v1alpha1_VirtualMachineClassList(a.(*v1alpha2.VirtualMachineClassList), b.(*VirtualMachineClassList), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineClassList)(nil), (*VirtualMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineClassList_To_v1alpha1_VirtualMachineClassList(a.(*v1alpha3.VirtualMachineClassList), b.(*VirtualMachineClassList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineClassPolicies)(nil), (*v1alpha2.VirtualMachineClassPolicies)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineClassPolicies_To_v1alpha2_VirtualMachineClassPolicies(a.(*VirtualMachineClassPolicies), b.(*v1alpha2.VirtualMachineClassPolicies), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineClassPolicies)(nil), (*v1alpha3.VirtualMachineClassPolicies)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineClassPolicies_To_v1alpha3_VirtualMachineClassPolicies(a.(*VirtualMachineClassPolicies), b.(*v1alpha3.VirtualMachineClassPolicies), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineClassPolicies)(nil), (*VirtualMachineClassPolicies)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineClassPolicies_To_v1alpha1_VirtualMachineClassPolicies(a.(*v1alpha2.VirtualMachineClassPolicies), b.(*VirtualMachineClassPolicies), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineClassPolicies)(nil), (*VirtualMachineClassPolicies)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineClassPolicies_To_v1alpha1_VirtualMachineClassPolicies(a.(*v1alpha3.VirtualMachineClassPolicies), b.(*VirtualMachineClassPolicies), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineClassResources)(nil), (*v1alpha2.VirtualMachineClassResources)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineClassResources_To_v1alpha2_VirtualMachineClassResources(a.(*VirtualMachineClassResources), b.(*v1alpha2.VirtualMachineClassResources), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineClassResources)(nil), (*v1alpha3.VirtualMachineClassResources)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineClassResources_To_v1alpha3_VirtualMachineClassResources(a.(*VirtualMachineClassResources), b.(*v1alpha3.VirtualMachineClassResources), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineClassResources)(nil), (*VirtualMachineClassResources)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineClassResources_To_v1alpha1_VirtualMachineClassResources(a.(*v1alpha2.VirtualMachineClassResources), b.(*VirtualMachineClassResources), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineClassResources)(nil), (*VirtualMachineClassResources)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineClassResources_To_v1alpha1_VirtualMachineClassResources(a.(*v1alpha3.VirtualMachineClassResources), b.(*VirtualMachineClassResources), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineClassSpec)(nil), (*v1alpha2.VirtualMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineClassSpec_To_v1alpha2_VirtualMachineClassSpec(a.(*VirtualMachineClassSpec), b.(*v1alpha2.VirtualMachineClassSpec), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineClassSpec)(nil), (*v1alpha3.VirtualMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineClassSpec_To_v1alpha3_VirtualMachineClassSpec(a.(*VirtualMachineClassSpec), b.(*v1alpha3.VirtualMachineClassSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineClassSpec)(nil), (*VirtualMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineClassSpec_To_v1alpha1_VirtualMachineClassSpec(a.(*v1alpha2.VirtualMachineClassSpec), b.(*VirtualMachineClassSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineClassSpec)(nil), (*VirtualMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineClassSpec_To_v1alpha1_VirtualMachineClassSpec(a.(*v1alpha3.VirtualMachineClassSpec), b.(*VirtualMachineClassSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineClassStatus)(nil), (*v1alpha2.VirtualMachineClassStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineClassStatus_To_v1alpha2_VirtualMachineClassStatus(a.(*VirtualMachineClassStatus), b.(*v1alpha2.VirtualMachineClassStatus), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineClassStatus)(nil), (*v1alpha3.VirtualMachineClassStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineClassStatus_To_v1alpha3_VirtualMachineClassStatus(a.(*VirtualMachineClassStatus), b.(*v1alpha3.VirtualMachineClassStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineImage)(nil), (*v1alpha2.VirtualMachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineImage_To_v1alpha2_VirtualMachineImage(a.(*VirtualMachineImage), b.(*v1alpha2.VirtualMachineImage), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineImage)(nil), (*v1alpha3.VirtualMachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineImage_To_v1alpha3_VirtualMachineImage(a.(*VirtualMachineImage), b.(*v1alpha3.VirtualMachineImage), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineImage)(nil), (*VirtualMachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineImage_To_v1alpha1_VirtualMachineImage(a.(*v1alpha2.VirtualMachineImage), b.(*VirtualMachineImage), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineImage)(nil), (*VirtualMachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineImage_To_v1alpha1_VirtualMachineImage(a.(*v1alpha3.VirtualMachineImage), b.(*VirtualMachineImage), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineImageList)(nil), (*v1alpha2.VirtualMachineImageList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineImageList_To_v1alpha2_VirtualMachineImageList(a.(*VirtualMachineImageList), b.(*v1alpha2.VirtualMachineImageList), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineImageList)(nil), (*v1alpha3.VirtualMachineImageList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineImageList_To_v1alpha3_VirtualMachineImageList(a.(*VirtualMachineImageList), b.(*v1alpha3.VirtualMachineImageList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineImageList)(nil), (*VirtualMachineImageList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineImageList_To_v1alpha1_VirtualMachineImageList(a.(*v1alpha2.VirtualMachineImageList), b.(*VirtualMachineImageList), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineImageList)(nil), (*VirtualMachineImageList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineImageList_To_v1alpha1_VirtualMachineImageList(a.(*v1alpha3.VirtualMachineImageList), b.(*VirtualMachineImageList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineImageOSInfo)(nil), (*v1alpha2.VirtualMachineImageOSInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha2_VirtualMachineImageOSInfo(a.(*VirtualMachineImageOSInfo), b.(*v1alpha2.VirtualMachineImageOSInfo), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineImageOSInfo)(nil), (*v1alpha3.VirtualMachineImageOSInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha3_VirtualMachineImageOSInfo(a.(*VirtualMachineImageOSInfo), b.(*v1alpha3.VirtualMachineImageOSInfo), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineImageProductInfo)(nil), (*v1alpha2.VirtualMachineImageProductInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineImageProductInfo_To_v1alpha2_VirtualMachineImageProductInfo(a.(*VirtualMachineImageProductInfo), b.(*v1alpha2.VirtualMachineImageProductInfo), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineImageProductInfo)(nil), (*v1alpha3.VirtualMachineImageProductInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineImageProductInfo_To_v1alpha3_VirtualMachineImageProductInfo(a.(*VirtualMachineImageProductInfo), b.(*v1alpha3.VirtualMachineImageProductInfo), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineImageProductInfo)(nil), (*VirtualMachineImageProductInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineImageProductInfo_To_v1alpha1_VirtualMachineImageProductInfo(a.(*v1alpha2.VirtualMachineImageProductInfo), b.(*VirtualMachineImageProductInfo), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineImageProductInfo)(nil), (*VirtualMachineImageProductInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineImageProductInfo_To_v1alpha1_VirtualMachineImageProductInfo(a.(*v1alpha3.VirtualMachineImageProductInfo), b.(*VirtualMachineImageProductInfo), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineImageSpec)(nil), (*VirtualMachineImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineImageSpec_To_v1alpha1_VirtualMachineImageSpec(a.(*v1alpha2.VirtualMachineImageSpec), b.(*VirtualMachineImageSpec), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineList)(nil), (*v1alpha3.VirtualMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineList_To_v1alpha3_VirtualMachineList(a.(*VirtualMachineList), b.(*v1alpha3.VirtualMachineList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineList)(nil), (*v1alpha2.VirtualMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineList_To_v1alpha2_VirtualMachineList(a.(*VirtualMachineList), b.(*v1alpha2.VirtualMachineList), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineList)(nil), (*VirtualMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineList_To_v1alpha1_VirtualMachineList(a.(*v1alpha3.VirtualMachineList), b.(*VirtualMachineList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineList)(nil), (*VirtualMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineList_To_v1alpha1_VirtualMachineList(a.(*v1alpha2.VirtualMachineList), b.(*VirtualMachineList), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequest)(nil), (*v1alpha3.VirtualMachinePublishRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachinePublishRequest_To_v1alpha3_VirtualMachinePublishRequest(a.(*VirtualMachinePublishRequest), b.(*v1alpha3.VirtualMachinePublishRequest), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequest)(nil), (*v1alpha2.VirtualMachinePublishRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachinePublishRequest_To_v1alpha2_VirtualMachinePublishRequest(a.(*VirtualMachinePublishRequest), b.(*v1alpha2.VirtualMachinePublishRequest), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequest)(nil), (*VirtualMachinePublishRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequest_To_v1alpha1_VirtualMachinePublishRequest(a.(*v1alpha3.VirtualMachinePublishRequest), b.(*VirtualMachinePublishRequest), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachinePublishRequest)(nil), (*VirtualMachinePublishRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachinePublishRequest_To_v1alpha1_VirtualMachinePublishRequest(a.(*v1alpha2.VirtualMachinePublishRequest), b.(*VirtualMachinePublishRequest), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestList)(nil), (*v1alpha3.VirtualMachinePublishRequestList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachinePublishRequestList_To_v1alpha3_VirtualMachinePublishRequestList(a.(*VirtualMachinePublishRequestList), b.(*v1alpha3.VirtualMachinePublishRequestList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestList)(nil), (*v1alpha2.VirtualMachinePublishRequestList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachinePublishRequestList_To_v1alpha2_VirtualMachinePublishRequestList(a.(*VirtualMachinePublishRequestList), b.(*v1alpha2.VirtualMachinePublishRequestList), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequestList)(nil), (*VirtualMachinePublishRequestList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequestList_To_v1alpha1_VirtualMachinePublishRequestList(a.(*v1alpha3.VirtualMachinePublishRequestList), b.(*VirtualMachinePublishRequestList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachinePublishRequestList)(nil), (*VirtualMachinePublishRequestList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachinePublishRequestList_To_v1alpha1_VirtualMachinePublishRequestList(a.(*v1alpha2.VirtualMachinePublishRequestList), b.(*VirtualMachinePublishRequestList), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestSource)(nil), (*v1alpha3.VirtualMachinePublishRequestSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachinePublishRequestSource_To_v1alpha3_VirtualMachinePublishRequestSource(a.(*VirtualMachinePublishRequestSource), b.(*v1alpha3.VirtualMachinePublishRequestSource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestSource)(nil), (*v1alpha2.VirtualMachinePublishRequestSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachinePublishRequestSource_To_v1alpha2_VirtualMachinePublishRequestSource(a.(*VirtualMachinePublishRequestSource), b.(*v1alpha2.VirtualMachinePublishRequestSource), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequestSource)(nil), (*VirtualMachinePublishRequestSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequestSource_To_v1alpha1_VirtualMachinePublishRequestSource(a.(*v1alpha3.VirtualMachinePublishRequestSource), b.(*VirtualMachinePublishRequestSource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachinePublishRequestSource)(nil), (*VirtualMachinePublishRequestSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachinePublishRequestSource_To_v1alpha1_VirtualMachinePublishRequestSource(a.(*v1alpha2.VirtualMachinePublishRequestSource), b.(*VirtualMachinePublishRequestSource), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestSpec)(nil), (*v1alpha3.VirtualMachinePublishRequestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachinePublishRequestSpec_To_v1alpha3_VirtualMachinePublishRequestSpec(a.(*VirtualMachinePublishRequestSpec), b.(*v1alpha3.VirtualMachinePublishRequestSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestSpec)(nil), (*v1alpha2.VirtualMachinePublishRequestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachinePublishRequestSpec_To_v1alpha2_VirtualMachinePublishRequestSpec(a.(*VirtualMachinePublishRequestSpec), b.(*v1alpha2.VirtualMachinePublishRequestSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequestSpec)(nil), (*VirtualMachinePublishRequestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequestSpec_To_v1alpha1_VirtualMachinePublishRequestSpec(a.(*v1alpha3.VirtualMachinePublishRequestSpec), b.(*VirtualMachinePublishRequestSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachinePublishRequestSpec)(nil), (*VirtualMachinePublishRequestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachinePublishRequestSpec_To_v1alpha1_VirtualMachinePublishRequestSpec(a.(*v1alpha2.VirtualMachinePublishRequestSpec), b.(*VirtualMachinePublishRequestSpec), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestStatus)(nil), (*v1alpha3.VirtualMachinePublishRequestStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachinePublishRequestStatus_To_v1alpha3_VirtualMachinePublishRequestStatus(a.(*VirtualMachinePublishRequestStatus), b.(*v1alpha3.VirtualMachinePublishRequestStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestStatus)(nil), (*v1alpha2.VirtualMachinePublishRequestStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachinePublishRequestStatus_To_v1alpha2_VirtualMachinePublishRequestStatus(a.(*VirtualMachinePublishRequestStatus), b.(*v1alpha2.VirtualMachinePublishRequestStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequestStatus)(nil), (*VirtualMachinePublishRequestStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequestStatus_To_v1alpha1_VirtualMachinePublishRequestStatus(a.(*v1alpha3.VirtualMachinePublishRequestStatus), b.(*VirtualMachinePublishRequestStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachinePublishRequestStatus)(nil), (*VirtualMachinePublishRequestStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachinePublishRequestStatus_To_v1alpha1_VirtualMachinePublishRequestStatus(a.(*v1alpha2.VirtualMachinePublishRequestStatus), b.(*VirtualMachinePublishRequestStatus), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestTarget)(nil), (*v1alpha3.VirtualMachinePublishRequestTarget)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachinePublishRequestTarget_To_v1alpha3_VirtualMachinePublishRequestTarget(a.(*VirtualMachinePublishRequestTarget), b.(*v1alpha3.VirtualMachinePublishRequestTarget), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestTarget)(nil), (*v1alpha2.VirtualMachinePublishRequestTarget)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachinePublishRequestTarget_To_v1alpha2_VirtualMachinePublishRequestTarget(a.(*VirtualMachinePublishRequestTarget), b.(*v1alpha2.VirtualMachinePublishRequestTarget), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequestTarget)(nil), (*VirtualMachinePublishRequestTarget)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequestTarget_To_v1alpha1_VirtualMachinePublishRequestTarget(a.(*v1alpha3.VirtualMachinePublishRequestTarget), b.(*VirtualMachinePublishRequestTarget), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachinePublishRequestTarget)(nil), (*VirtualMachinePublishRequestTarget)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachinePublishRequestTarget_To_v1alpha1_VirtualMachinePublishRequestTarget(a.(*v1alpha2.VirtualMachinePublishRequestTarget), b.(*VirtualMachinePublishRequestTarget), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestTargetItem)(nil), (*v1alpha3.VirtualMachinePublishRequestTargetItem)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachinePublishRequestTargetItem_To_v1alpha3_VirtualMachinePublishRequestTargetItem(a.(*VirtualMachinePublishRequestTargetItem), b.(*v1alpha3.VirtualMachinePublishRequestTargetItem), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestTargetItem)(nil), (*v1alpha2.VirtualMachinePublishRequestTargetItem)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachinePublishRequestTargetItem_To_v1alpha2_VirtualMachinePublishRequestTargetItem(a.(*VirtualMachinePublishRequestTargetItem), b.(*v1alpha2.VirtualMachinePublishRequestTargetItem), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequestTargetItem)(nil), (*VirtualMachinePublishRequestTargetItem)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequestTargetItem_To_v1alpha1_VirtualMachinePublishRequestTargetItem(a.(*v1alpha3.VirtualMachinePublishRequestTargetItem), b.(*VirtualMachinePublishRequestTargetItem), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachinePublishRequestTargetItem)(nil), (*VirtualMachinePublishRequestTargetItem)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachinePublishRequestTargetItem_To_v1alpha1_VirtualMachinePublishRequestTargetItem(a.(*v1alpha2.VirtualMachinePublishRequestTargetItem), b.(*VirtualMachinePublishRequestTargetItem), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestTargetLocation)(nil), (*v1alpha3.VirtualMachinePublishRequestTargetLocation)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachinePublishRequestTargetLocation_To_v1alpha3_VirtualMachinePublishRequestTargetLocation(a.(*VirtualMachinePublishRequestTargetLocation), b.(*v1alpha3.VirtualMachinePublishRequestTargetLocation), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestTargetLocation)(nil), (*v1alpha2.VirtualMachinePublishRequestTargetLocation)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachinePublishRequestTargetLocation_To_v1alpha2_VirtualMachinePublishRequestTargetLocation(a.(*VirtualMachinePublishRequestTargetLocation), b.(*v1alpha2.VirtualMachinePublishRequestTargetLocation), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequestTargetLocation)(nil), (*VirtualMachinePublishRequestTargetLocation)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequestTargetLocation_To_v1alpha1_VirtualMachinePublishRequestTargetLocation(a.(*v1alpha3.VirtualMachinePublishRequestTargetLocation), b.(*VirtualMachinePublishRequestTargetLocation), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachinePublishRequestTargetLocation)(nil), (*VirtualMachinePublishRequestTargetLocation)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachinePublishRequestTargetLocation_To_v1alpha1_VirtualMachinePublishRequestTargetLocation(a.(*v1alpha2.VirtualMachinePublishRequestTargetLocation), b.(*VirtualMachinePublishRequestTargetLocation), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineResourceSpec)(nil), (*v1alpha3.VirtualMachineResourceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(a.(*VirtualMachineResourceSpec), b.(*v1alpha3.VirtualMachineResourceSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineResourceSpec)(nil), (*v1alpha2.VirtualMachineResourceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(a.(*VirtualMachineResourceSpec), b.(*v1alpha2.VirtualMachineResourceSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineResourceSpec)(nil), (*VirtualMachineResourceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(a.(*v1alpha3.VirtualMachineResourceSpec), b.(*VirtualMachineResourceSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineResourceSpec)(nil), (*VirtualMachineResourceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(a.(*v1alpha2.VirtualMachineResourceSpec), b.(*VirtualMachineResourceSpec), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineService)(nil), (*v1alpha3.VirtualMachineService)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineService_To_v1alpha3_VirtualMachineService(a.(*VirtualMachineService), b.(*v1alpha3.VirtualMachineService), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineService)(nil), (*v1alpha2.VirtualMachineService)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineService_To_v1alpha2_VirtualMachineService(a.(*VirtualMachineService), b.(*v1alpha2.VirtualMachineService), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineService)(nil), (*VirtualMachineService)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineService_To_v1alpha1_VirtualMachineService(a.(*v1alpha3.VirtualMachineService), b.(*VirtualMachineService), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineService)(nil), (*VirtualMachineService)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineService_To_v1alpha1_VirtualMachineService(a.(*v1alpha2.VirtualMachineService), b.(*VirtualMachineService), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineServiceList)(nil), (*v1alpha3.VirtualMachineServiceList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineServiceList_To_v1alpha3_VirtualMachineServiceList(a.(*VirtualMachineServiceList), b.(*v1alpha3.VirtualMachineServiceList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineServiceList)(nil), (*v1alpha2.VirtualMachineServiceList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineServiceList_To_v1alpha2_VirtualMachineServiceList(a.(*VirtualMachineServiceList), b.(*v1alpha2.VirtualMachineServiceList), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineServiceList)(nil), (*VirtualMachineServiceList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineServiceList_To_v1alpha1_VirtualMachineServiceList(a.(*v1alpha3.VirtualMachineServiceList), b.(*VirtualMachineServiceList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineServiceList)(nil), (*VirtualMachineServiceList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineServiceList_To_v1alpha1_VirtualMachineServiceList(a.(*v1alpha2.VirtualMachineServiceList), b.(*VirtualMachineServiceList), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineServicePort)(nil), (*v1alpha3.VirtualMachineServicePort)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineServicePort_To_v1alpha3_VirtualMachineServicePort(a.(*VirtualMachineServicePort), b.(*v1alpha3.VirtualMachineServicePort), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineServicePort)(nil), (*v1alpha2.VirtualMachineServicePort)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineServicePort_To_v1alpha2_VirtualMachineServicePort(a.(*VirtualMachineServicePort), b.(*v1alpha2.VirtualMachineServicePort), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineServicePort)(nil), (*VirtualMachineServicePort)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineServicePort_To_v1alpha1_VirtualMachineServicePort(a.(*v1alpha3.VirtualMachineServicePort), b.(*VirtualMachineServicePort), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineServicePort)(nil), (*VirtualMachineServicePort)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineServicePort_To_v1alpha1_VirtualMachineServicePort(a.(*v1alpha2.VirtualMachineServicePort), b.(*VirtualMachineServicePort), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineServiceSpec)(nil), (*v1alpha3.VirtualMachineServiceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineServiceSpec_To_v1alpha3_VirtualMachineServiceSpec(a.(*VirtualMachineServiceSpec), b.(*v1alpha3.VirtualMachineServiceSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineServiceSpec)(nil), (*v1alpha2.VirtualMachineServiceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineServiceSpec_To_v1alpha2_VirtualMachineServiceSpec(a.(*VirtualMachineServiceSpec), b.(*v1alpha2.VirtualMachineServiceSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineServiceSpec)(nil), (*VirtualMachineServiceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineServiceSpec_To_v1alpha1_VirtualMachineServiceSpec(a.(*v1alpha3.VirtualMachineServiceSpec), b.(*VirtualMachineServiceSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineServiceSpec)(nil), (*VirtualMachineServiceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineServiceSpec_To_v1alpha1_VirtualMachineServiceSpec(a.(*v1alpha2.VirtualMachineServiceSpec), b.(*VirtualMachineServiceSpec), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineServiceStatus)(nil), (*v1alpha3.VirtualMachineServiceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineServiceStatus_To_v1alpha3_VirtualMachineServiceStatus(a.(*VirtualMachineServiceStatus), b.(*v1alpha3.VirtualMachineServiceStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineServiceStatus)(nil), (*v1alpha2.VirtualMachineServiceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineServiceStatus_To_v1alpha2_VirtualMachineServiceStatus(a.(*VirtualMachineServiceStatus), b.(*v1alpha2.VirtualMachineServiceStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineServiceStatus)(nil), (*VirtualMachineServiceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineServiceStatus_To_v1alpha1_VirtualMachineServiceStatus(a.(*v1alpha3.VirtualMachineServiceStatus), b.(*VirtualMachineServiceStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineServiceStatus)(nil), (*VirtualMachineServiceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineServiceStatus_To_v1alpha1_VirtualMachineServiceStatus(a.(*v1alpha2.VirtualMachineServiceStatus), b.(*VirtualMachineServiceStatus), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineSetResourcePolicy)(nil), (*v1alpha3.VirtualMachineSetResourcePolicy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineSetResourcePolicy_To_v1alpha3_VirtualMachineSetResourcePolicy(a.(*VirtualMachineSetResourcePolicy), b.(*v1alpha3.VirtualMachineSetResourcePolicy), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineSetResourcePolicy)(nil), (*v1alpha2.VirtualMachineSetResourcePolicy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineSetResourcePolicy_To_v1alpha2_VirtualMachineSetResourcePolicy(a.(*VirtualMachineSetResourcePolicy), b.(*v1alpha2.VirtualMachineSetResourcePolicy), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineSetResourcePolicy)(nil), (*VirtualMachineSetResourcePolicy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineSetResourcePolicy_To_v1alpha1_VirtualMachineSetResourcePolicy(a.(*v1alpha3.VirtualMachineSetResourcePolicy), b.(*VirtualMachineSetResourcePolicy), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineSetResourcePolicy)(nil), (*VirtualMachineSetResourcePolicy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineSetResourcePolicy_To_v1alpha1_VirtualMachineSetResourcePolicy(a.(*v1alpha2.VirtualMachineSetResourcePolicy), b.(*VirtualMachineSetResourcePolicy), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineSetResourcePolicyList)(nil), (*v1alpha3.VirtualMachineSetResourcePolicyList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineSetResourcePolicyList_To_v1alpha3_VirtualMachineSetResourcePolicyList(a.(*VirtualMachineSetResourcePolicyList), b.(*v1alpha3.VirtualMachineSetResourcePolicyList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineSetResourcePolicyList)(nil), (*v1alpha2.VirtualMachineSetResourcePolicyList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineSetResourcePolicyList_To_v1alpha2_VirtualMachineSetResourcePolicyList(a.(*VirtualMachineSetResourcePolicyList), b.(*v1alpha2.VirtualMachineSetResourcePolicyList), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineSetResourcePolicyList)(nil), (*VirtualMachineSetResourcePolicyList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineSetResourcePolicyList_To_v1alpha1_VirtualMachineSetResourcePolicyList(a.(*v1alpha3.VirtualMachineSetResourcePolicyList), b.(*VirtualMachineSetResourcePolicyList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineSetResourcePolicyList)(nil), (*VirtualMachineSetResourcePolicyList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineSetResourcePolicyList_To_v1alpha1_VirtualMachineSetResourcePolicyList(a.(*v1alpha2.VirtualMachineSetResourcePolicyList), b.(*VirtualMachineSetResourcePolicyList), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineSetResourcePolicyStatus)(nil), (*v1alpha3.VirtualMachineSetResourcePolicyStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineSetResourcePolicyStatus_To_v1alpha3_VirtualMachineSetResourcePolicyStatus(a.(*VirtualMachineSetResourcePolicyStatus), b.(*v1alpha3.VirtualMachineSetResourcePolicyStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineSetResourcePolicyStatus)(nil), (*v1alpha2.VirtualMachineSetResourcePolicyStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineSetResourcePolicyStatus_To_v1alpha2_VirtualMachineSetResourcePolicyStatus(a.(*VirtualMachineSetResourcePolicyStatus), b.(*v1alpha2.VirtualMachineSetResourcePolicyStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineSetResourcePolicyStatus)(nil), (*VirtualMachineSetResourcePolicyStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineSetResourcePolicyStatus_To_v1alpha1_VirtualMachineSetResourcePolicyStatus(a.(*v1alpha3.VirtualMachineSetResourcePolicyStatus), b.(*VirtualMachineSetResourcePolicyStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineSetResourcePolicyStatus)(nil), (*VirtualMachineSetResourcePolicyStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineSetResourcePolicyStatus_To_v1alpha1_VirtualMachineSetResourcePolicyStatus(a.(*v1alpha2.VirtualMachineSetResourcePolicyStatus), b.(*VirtualMachineSetResourcePolicyStatus), scope) + if err := s.AddGeneratedConversionFunc((*VirtualMachineTemplate)(nil), (*v1alpha3.VirtualMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineTemplate_To_v1alpha3_VirtualMachineTemplate(a.(*VirtualMachineTemplate), b.(*v1alpha3.VirtualMachineTemplate), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VirtualMachineTemplate)(nil), (*v1alpha2.VirtualMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineTemplate_To_v1alpha2_VirtualMachineTemplate(a.(*VirtualMachineTemplate), b.(*v1alpha2.VirtualMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VirtualMachineTemplate)(nil), (*VirtualMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineTemplate_To_v1alpha1_VirtualMachineTemplate(a.(*v1alpha2.VirtualMachineTemplate), b.(*VirtualMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*common.LocalObjectRef)(nil), (*ContentProviderReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_common_LocalObjectRef_To_v1alpha1_ContentProviderReference(a.(*common.LocalObjectRef), b.(*ContentProviderReference), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineTemplate)(nil), (*VirtualMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineTemplate_To_v1alpha1_VirtualMachineTemplate(a.(*v1alpha3.VirtualMachineTemplate), b.(*VirtualMachineTemplate), scope) }); err != nil { return err } @@ -507,138 +496,138 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddConversionFunc((*ContentProviderReference)(nil), (*common.LocalObjectRef)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ContentProviderReference_To_common_LocalObjectRef(a.(*ContentProviderReference), b.(*common.LocalObjectRef), scope) + if err := s.AddConversionFunc((*Probe)(nil), (*v1alpha3.VirtualMachineReadinessProbeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_Probe_To_v1alpha3_VirtualMachineReadinessProbeSpec(a.(*Probe), b.(*v1alpha3.VirtualMachineReadinessProbeSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*Probe)(nil), (*v1alpha2.VirtualMachineReadinessProbeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_Probe_To_v1alpha2_VirtualMachineReadinessProbeSpec(a.(*Probe), b.(*v1alpha2.VirtualMachineReadinessProbeSpec), scope) + if err := s.AddConversionFunc((*VirtualMachineImageSpec)(nil), (*v1alpha3.VirtualMachineImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageSpec(a.(*VirtualMachineImageSpec), b.(*v1alpha3.VirtualMachineImageSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*VirtualMachineImageSpec)(nil), (*v1alpha2.VirtualMachineImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSpec(a.(*VirtualMachineImageSpec), b.(*v1alpha2.VirtualMachineImageSpec), scope) + if err := s.AddConversionFunc((*VirtualMachineImageStatus)(nil), (*v1alpha3.VirtualMachineImageStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineImageStatus_To_v1alpha3_VirtualMachineImageStatus(a.(*VirtualMachineImageStatus), b.(*v1alpha3.VirtualMachineImageStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*VirtualMachineImageStatus)(nil), (*v1alpha2.VirtualMachineImageStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineImageStatus(a.(*VirtualMachineImageStatus), b.(*v1alpha2.VirtualMachineImageStatus), scope) + if err := s.AddConversionFunc((*VirtualMachineSetResourcePolicySpec)(nil), (*v1alpha3.VirtualMachineSetResourcePolicySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineSetResourcePolicySpec_To_v1alpha3_VirtualMachineSetResourcePolicySpec(a.(*VirtualMachineSetResourcePolicySpec), b.(*v1alpha3.VirtualMachineSetResourcePolicySpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*VirtualMachineSetResourcePolicySpec)(nil), (*v1alpha2.VirtualMachineSetResourcePolicySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineSetResourcePolicySpec_To_v1alpha2_VirtualMachineSetResourcePolicySpec(a.(*VirtualMachineSetResourcePolicySpec), b.(*v1alpha2.VirtualMachineSetResourcePolicySpec), scope) + if err := s.AddConversionFunc((*VirtualMachineSpec)(nil), (*v1alpha3.VirtualMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineSpec_To_v1alpha3_VirtualMachineSpec(a.(*VirtualMachineSpec), b.(*v1alpha3.VirtualMachineSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*VirtualMachineSpec)(nil), (*v1alpha2.VirtualMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec(a.(*VirtualMachineSpec), b.(*v1alpha2.VirtualMachineSpec), scope) + if err := s.AddConversionFunc((*VirtualMachineStatus)(nil), (*v1alpha3.VirtualMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineStatus_To_v1alpha3_VirtualMachineStatus(a.(*VirtualMachineStatus), b.(*v1alpha3.VirtualMachineStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*VirtualMachineStatus)(nil), (*v1alpha2.VirtualMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineStatus_To_v1alpha2_VirtualMachineStatus(a.(*VirtualMachineStatus), b.(*v1alpha2.VirtualMachineStatus), scope) + if err := s.AddConversionFunc((*VirtualMachineVolumeStatus)(nil), (*v1alpha3.VirtualMachineVolumeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineVolumeStatus_To_v1alpha3_VirtualMachineVolumeStatus(a.(*VirtualMachineVolumeStatus), b.(*v1alpha3.VirtualMachineVolumeStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*VirtualMachineVolumeStatus)(nil), (*v1alpha2.VirtualMachineVolumeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineVolumeStatus_To_v1alpha2_VirtualMachineVolumeStatus(a.(*VirtualMachineVolumeStatus), b.(*v1alpha2.VirtualMachineVolumeStatus), scope) + if err := s.AddConversionFunc((*VirtualMachineVolume)(nil), (*v1alpha3.VirtualMachineVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VirtualMachineVolume_To_v1alpha3_VirtualMachineVolume(a.(*VirtualMachineVolume), b.(*v1alpha3.VirtualMachineVolume), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*VirtualMachineVolume)(nil), (*v1alpha2.VirtualMachineVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VirtualMachineVolume_To_v1alpha2_VirtualMachineVolume(a.(*VirtualMachineVolume), b.(*v1alpha2.VirtualMachineVolume), scope) + if err := s.AddConversionFunc((*v1alpha3.VirtualMachineClassStatus)(nil), (*VirtualMachineClassStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineClassStatus_To_v1alpha1_VirtualMachineClassStatus(a.(*v1alpha3.VirtualMachineClassStatus), b.(*VirtualMachineClassStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha2.VirtualMachineClassStatus)(nil), (*VirtualMachineClassStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineClassStatus_To_v1alpha1_VirtualMachineClassStatus(a.(*v1alpha2.VirtualMachineClassStatus), b.(*VirtualMachineClassStatus), scope) + if err := s.AddConversionFunc((*v1alpha3.VirtualMachineImageOSInfo)(nil), (*VirtualMachineImageOSInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineImageOSInfo_To_v1alpha1_VirtualMachineImageOSInfo(a.(*v1alpha3.VirtualMachineImageOSInfo), b.(*VirtualMachineImageOSInfo), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha2.VirtualMachineImageOSInfo)(nil), (*VirtualMachineImageOSInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineImageOSInfo_To_v1alpha1_VirtualMachineImageOSInfo(a.(*v1alpha2.VirtualMachineImageOSInfo), b.(*VirtualMachineImageOSInfo), scope) + if err := s.AddConversionFunc((*v1alpha3.VirtualMachineImageSpec)(nil), (*VirtualMachineImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineImageSpec_To_v1alpha1_VirtualMachineImageSpec(a.(*v1alpha3.VirtualMachineImageSpec), b.(*VirtualMachineImageSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha2.VirtualMachineImageStatus)(nil), (*VirtualMachineImageStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageStatus(a.(*v1alpha2.VirtualMachineImageStatus), b.(*VirtualMachineImageStatus), scope) + if err := s.AddConversionFunc((*v1alpha3.VirtualMachineImageStatus)(nil), (*VirtualMachineImageStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageStatus(a.(*v1alpha3.VirtualMachineImageStatus), b.(*VirtualMachineImageStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha2.VirtualMachineReadinessProbeSpec)(nil), (*Probe)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineReadinessProbeSpec_To_v1alpha1_Probe(a.(*v1alpha2.VirtualMachineReadinessProbeSpec), b.(*Probe), scope) + if err := s.AddConversionFunc((*v1alpha3.VirtualMachineReadinessProbeSpec)(nil), (*Probe)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineReadinessProbeSpec_To_v1alpha1_Probe(a.(*v1alpha3.VirtualMachineReadinessProbeSpec), b.(*Probe), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha2.VirtualMachineSetResourcePolicySpec)(nil), (*VirtualMachineSetResourcePolicySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineSetResourcePolicySpec_To_v1alpha1_VirtualMachineSetResourcePolicySpec(a.(*v1alpha2.VirtualMachineSetResourcePolicySpec), b.(*VirtualMachineSetResourcePolicySpec), scope) + if err := s.AddConversionFunc((*v1alpha3.VirtualMachineSetResourcePolicySpec)(nil), (*VirtualMachineSetResourcePolicySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineSetResourcePolicySpec_To_v1alpha1_VirtualMachineSetResourcePolicySpec(a.(*v1alpha3.VirtualMachineSetResourcePolicySpec), b.(*VirtualMachineSetResourcePolicySpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha2.VirtualMachineSpec)(nil), (*VirtualMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineSpec_To_v1alpha1_VirtualMachineSpec(a.(*v1alpha2.VirtualMachineSpec), b.(*VirtualMachineSpec), scope) + if err := s.AddConversionFunc((*v1alpha3.VirtualMachineSpec)(nil), (*VirtualMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineSpec_To_v1alpha1_VirtualMachineSpec(a.(*v1alpha3.VirtualMachineSpec), b.(*VirtualMachineSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha2.VirtualMachineStatus)(nil), (*VirtualMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineStatus_To_v1alpha1_VirtualMachineStatus(a.(*v1alpha2.VirtualMachineStatus), b.(*VirtualMachineStatus), scope) + if err := s.AddConversionFunc((*v1alpha3.VirtualMachineStatus)(nil), (*VirtualMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineStatus_To_v1alpha1_VirtualMachineStatus(a.(*v1alpha3.VirtualMachineStatus), b.(*VirtualMachineStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha2.VirtualMachineVolumeStatus)(nil), (*VirtualMachineVolumeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineVolumeStatus_To_v1alpha1_VirtualMachineVolumeStatus(a.(*v1alpha2.VirtualMachineVolumeStatus), b.(*VirtualMachineVolumeStatus), scope) + if err := s.AddConversionFunc((*v1alpha3.VirtualMachineVolumeStatus)(nil), (*VirtualMachineVolumeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineVolumeStatus_To_v1alpha1_VirtualMachineVolumeStatus(a.(*v1alpha3.VirtualMachineVolumeStatus), b.(*VirtualMachineVolumeStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha2.VirtualMachineVolume)(nil), (*VirtualMachineVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VirtualMachineVolume_To_v1alpha1_VirtualMachineVolume(a.(*v1alpha2.VirtualMachineVolume), b.(*VirtualMachineVolume), scope) + if err := s.AddConversionFunc((*v1alpha3.VirtualMachineVolume)(nil), (*VirtualMachineVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineVolume_To_v1alpha1_VirtualMachineVolume(a.(*v1alpha3.VirtualMachineVolume), b.(*VirtualMachineVolume), scope) }); err != nil { return err } return nil } -func autoConvert_v1alpha1_ClusterVirtualMachineImage_To_v1alpha2_ClusterVirtualMachineImage(in *ClusterVirtualMachineImage, out *v1alpha2.ClusterVirtualMachineImage, s conversion.Scope) error { +func autoConvert_v1alpha1_ClusterVirtualMachineImage_To_v1alpha3_ClusterVirtualMachineImage(in *ClusterVirtualMachineImage, out *v1alpha3.ClusterVirtualMachineImage, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha1_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineImageStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineImageStatus_To_v1alpha3_VirtualMachineImageStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha1_ClusterVirtualMachineImage_To_v1alpha2_ClusterVirtualMachineImage is an autogenerated conversion function. -func Convert_v1alpha1_ClusterVirtualMachineImage_To_v1alpha2_ClusterVirtualMachineImage(in *ClusterVirtualMachineImage, out *v1alpha2.ClusterVirtualMachineImage, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterVirtualMachineImage_To_v1alpha2_ClusterVirtualMachineImage(in, out, s) +// Convert_v1alpha1_ClusterVirtualMachineImage_To_v1alpha3_ClusterVirtualMachineImage is an autogenerated conversion function. +func Convert_v1alpha1_ClusterVirtualMachineImage_To_v1alpha3_ClusterVirtualMachineImage(in *ClusterVirtualMachineImage, out *v1alpha3.ClusterVirtualMachineImage, s conversion.Scope) error { + return autoConvert_v1alpha1_ClusterVirtualMachineImage_To_v1alpha3_ClusterVirtualMachineImage(in, out, s) } -func autoConvert_v1alpha2_ClusterVirtualMachineImage_To_v1alpha1_ClusterVirtualMachineImage(in *v1alpha2.ClusterVirtualMachineImage, out *ClusterVirtualMachineImage, s conversion.Scope) error { +func autoConvert_v1alpha3_ClusterVirtualMachineImage_To_v1alpha1_ClusterVirtualMachineImage(in *v1alpha3.ClusterVirtualMachineImage, out *ClusterVirtualMachineImage, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_VirtualMachineImageSpec_To_v1alpha1_VirtualMachineImageSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineImageSpec_To_v1alpha1_VirtualMachineImageSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha2_ClusterVirtualMachineImage_To_v1alpha1_ClusterVirtualMachineImage is an autogenerated conversion function. -func Convert_v1alpha2_ClusterVirtualMachineImage_To_v1alpha1_ClusterVirtualMachineImage(in *v1alpha2.ClusterVirtualMachineImage, out *ClusterVirtualMachineImage, s conversion.Scope) error { - return autoConvert_v1alpha2_ClusterVirtualMachineImage_To_v1alpha1_ClusterVirtualMachineImage(in, out, s) +// Convert_v1alpha3_ClusterVirtualMachineImage_To_v1alpha1_ClusterVirtualMachineImage is an autogenerated conversion function. +func Convert_v1alpha3_ClusterVirtualMachineImage_To_v1alpha1_ClusterVirtualMachineImage(in *v1alpha3.ClusterVirtualMachineImage, out *ClusterVirtualMachineImage, s conversion.Scope) error { + return autoConvert_v1alpha3_ClusterVirtualMachineImage_To_v1alpha1_ClusterVirtualMachineImage(in, out, s) } -func autoConvert_v1alpha1_ClusterVirtualMachineImageList_To_v1alpha2_ClusterVirtualMachineImageList(in *ClusterVirtualMachineImageList, out *v1alpha2.ClusterVirtualMachineImageList, s conversion.Scope) error { +func autoConvert_v1alpha1_ClusterVirtualMachineImageList_To_v1alpha3_ClusterVirtualMachineImageList(in *ClusterVirtualMachineImageList, out *v1alpha3.ClusterVirtualMachineImageList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha2.ClusterVirtualMachineImage, len(*in)) + *out = make([]v1alpha3.ClusterVirtualMachineImage, len(*in)) for i := range *in { - if err := Convert_v1alpha1_ClusterVirtualMachineImage_To_v1alpha2_ClusterVirtualMachineImage(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha1_ClusterVirtualMachineImage_To_v1alpha3_ClusterVirtualMachineImage(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -648,18 +637,18 @@ func autoConvert_v1alpha1_ClusterVirtualMachineImageList_To_v1alpha2_ClusterVirt return nil } -// Convert_v1alpha1_ClusterVirtualMachineImageList_To_v1alpha2_ClusterVirtualMachineImageList is an autogenerated conversion function. -func Convert_v1alpha1_ClusterVirtualMachineImageList_To_v1alpha2_ClusterVirtualMachineImageList(in *ClusterVirtualMachineImageList, out *v1alpha2.ClusterVirtualMachineImageList, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterVirtualMachineImageList_To_v1alpha2_ClusterVirtualMachineImageList(in, out, s) +// Convert_v1alpha1_ClusterVirtualMachineImageList_To_v1alpha3_ClusterVirtualMachineImageList is an autogenerated conversion function. +func Convert_v1alpha1_ClusterVirtualMachineImageList_To_v1alpha3_ClusterVirtualMachineImageList(in *ClusterVirtualMachineImageList, out *v1alpha3.ClusterVirtualMachineImageList, s conversion.Scope) error { + return autoConvert_v1alpha1_ClusterVirtualMachineImageList_To_v1alpha3_ClusterVirtualMachineImageList(in, out, s) } -func autoConvert_v1alpha2_ClusterVirtualMachineImageList_To_v1alpha1_ClusterVirtualMachineImageList(in *v1alpha2.ClusterVirtualMachineImageList, out *ClusterVirtualMachineImageList, s conversion.Scope) error { +func autoConvert_v1alpha3_ClusterVirtualMachineImageList_To_v1alpha1_ClusterVirtualMachineImageList(in *v1alpha3.ClusterVirtualMachineImageList, out *ClusterVirtualMachineImageList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]ClusterVirtualMachineImage, len(*in)) for i := range *in { - if err := Convert_v1alpha2_ClusterVirtualMachineImage_To_v1alpha1_ClusterVirtualMachineImage(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_ClusterVirtualMachineImage_To_v1alpha1_ClusterVirtualMachineImage(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -669,9 +658,9 @@ func autoConvert_v1alpha2_ClusterVirtualMachineImageList_To_v1alpha1_ClusterVirt return nil } -// Convert_v1alpha2_ClusterVirtualMachineImageList_To_v1alpha1_ClusterVirtualMachineImageList is an autogenerated conversion function. -func Convert_v1alpha2_ClusterVirtualMachineImageList_To_v1alpha1_ClusterVirtualMachineImageList(in *v1alpha2.ClusterVirtualMachineImageList, out *ClusterVirtualMachineImageList, s conversion.Scope) error { - return autoConvert_v1alpha2_ClusterVirtualMachineImageList_To_v1alpha1_ClusterVirtualMachineImageList(in, out, s) +// Convert_v1alpha3_ClusterVirtualMachineImageList_To_v1alpha1_ClusterVirtualMachineImageList is an autogenerated conversion function. +func Convert_v1alpha3_ClusterVirtualMachineImageList_To_v1alpha1_ClusterVirtualMachineImageList(in *v1alpha3.ClusterVirtualMachineImageList, out *ClusterVirtualMachineImageList, s conversion.Scope) error { + return autoConvert_v1alpha3_ClusterVirtualMachineImageList_To_v1alpha1_ClusterVirtualMachineImageList(in, out, s) } func autoConvert_v1alpha1_Condition_To_v1_Condition(in *Condition, out *v1.Condition, s conversion.Scope) error { @@ -694,305 +683,305 @@ func autoConvert_v1_Condition_To_v1alpha1_Condition(in *v1.Condition, out *Condi return nil } -func autoConvert_v1alpha1_DynamicDirectPathIODevice_To_v1alpha2_DynamicDirectPathIODevice(in *DynamicDirectPathIODevice, out *v1alpha2.DynamicDirectPathIODevice, s conversion.Scope) error { +func autoConvert_v1alpha1_DynamicDirectPathIODevice_To_v1alpha3_DynamicDirectPathIODevice(in *DynamicDirectPathIODevice, out *v1alpha3.DynamicDirectPathIODevice, s conversion.Scope) error { out.VendorID = int64(in.VendorID) out.DeviceID = int64(in.DeviceID) out.CustomLabel = in.CustomLabel return nil } -// Convert_v1alpha1_DynamicDirectPathIODevice_To_v1alpha2_DynamicDirectPathIODevice is an autogenerated conversion function. -func Convert_v1alpha1_DynamicDirectPathIODevice_To_v1alpha2_DynamicDirectPathIODevice(in *DynamicDirectPathIODevice, out *v1alpha2.DynamicDirectPathIODevice, s conversion.Scope) error { - return autoConvert_v1alpha1_DynamicDirectPathIODevice_To_v1alpha2_DynamicDirectPathIODevice(in, out, s) +// Convert_v1alpha1_DynamicDirectPathIODevice_To_v1alpha3_DynamicDirectPathIODevice is an autogenerated conversion function. +func Convert_v1alpha1_DynamicDirectPathIODevice_To_v1alpha3_DynamicDirectPathIODevice(in *DynamicDirectPathIODevice, out *v1alpha3.DynamicDirectPathIODevice, s conversion.Scope) error { + return autoConvert_v1alpha1_DynamicDirectPathIODevice_To_v1alpha3_DynamicDirectPathIODevice(in, out, s) } -func autoConvert_v1alpha2_DynamicDirectPathIODevice_To_v1alpha1_DynamicDirectPathIODevice(in *v1alpha2.DynamicDirectPathIODevice, out *DynamicDirectPathIODevice, s conversion.Scope) error { +func autoConvert_v1alpha3_DynamicDirectPathIODevice_To_v1alpha1_DynamicDirectPathIODevice(in *v1alpha3.DynamicDirectPathIODevice, out *DynamicDirectPathIODevice, s conversion.Scope) error { out.VendorID = int(in.VendorID) out.DeviceID = int(in.DeviceID) out.CustomLabel = in.CustomLabel return nil } -// Convert_v1alpha2_DynamicDirectPathIODevice_To_v1alpha1_DynamicDirectPathIODevice is an autogenerated conversion function. -func Convert_v1alpha2_DynamicDirectPathIODevice_To_v1alpha1_DynamicDirectPathIODevice(in *v1alpha2.DynamicDirectPathIODevice, out *DynamicDirectPathIODevice, s conversion.Scope) error { - return autoConvert_v1alpha2_DynamicDirectPathIODevice_To_v1alpha1_DynamicDirectPathIODevice(in, out, s) +// Convert_v1alpha3_DynamicDirectPathIODevice_To_v1alpha1_DynamicDirectPathIODevice is an autogenerated conversion function. +func Convert_v1alpha3_DynamicDirectPathIODevice_To_v1alpha1_DynamicDirectPathIODevice(in *v1alpha3.DynamicDirectPathIODevice, out *DynamicDirectPathIODevice, s conversion.Scope) error { + return autoConvert_v1alpha3_DynamicDirectPathIODevice_To_v1alpha1_DynamicDirectPathIODevice(in, out, s) } -func autoConvert_v1alpha1_GuestHeartbeatAction_To_v1alpha2_GuestHeartbeatAction(in *GuestHeartbeatAction, out *v1alpha2.GuestHeartbeatAction, s conversion.Scope) error { - out.ThresholdStatus = v1alpha2.GuestHeartbeatStatus(in.ThresholdStatus) +func autoConvert_v1alpha1_GuestHeartbeatAction_To_v1alpha3_GuestHeartbeatAction(in *GuestHeartbeatAction, out *v1alpha3.GuestHeartbeatAction, s conversion.Scope) error { + out.ThresholdStatus = v1alpha3.GuestHeartbeatStatus(in.ThresholdStatus) return nil } -// Convert_v1alpha1_GuestHeartbeatAction_To_v1alpha2_GuestHeartbeatAction is an autogenerated conversion function. -func Convert_v1alpha1_GuestHeartbeatAction_To_v1alpha2_GuestHeartbeatAction(in *GuestHeartbeatAction, out *v1alpha2.GuestHeartbeatAction, s conversion.Scope) error { - return autoConvert_v1alpha1_GuestHeartbeatAction_To_v1alpha2_GuestHeartbeatAction(in, out, s) +// Convert_v1alpha1_GuestHeartbeatAction_To_v1alpha3_GuestHeartbeatAction is an autogenerated conversion function. +func Convert_v1alpha1_GuestHeartbeatAction_To_v1alpha3_GuestHeartbeatAction(in *GuestHeartbeatAction, out *v1alpha3.GuestHeartbeatAction, s conversion.Scope) error { + return autoConvert_v1alpha1_GuestHeartbeatAction_To_v1alpha3_GuestHeartbeatAction(in, out, s) } -func autoConvert_v1alpha2_GuestHeartbeatAction_To_v1alpha1_GuestHeartbeatAction(in *v1alpha2.GuestHeartbeatAction, out *GuestHeartbeatAction, s conversion.Scope) error { +func autoConvert_v1alpha3_GuestHeartbeatAction_To_v1alpha1_GuestHeartbeatAction(in *v1alpha3.GuestHeartbeatAction, out *GuestHeartbeatAction, s conversion.Scope) error { out.ThresholdStatus = GuestHeartbeatStatus(in.ThresholdStatus) return nil } -// Convert_v1alpha2_GuestHeartbeatAction_To_v1alpha1_GuestHeartbeatAction is an autogenerated conversion function. -func Convert_v1alpha2_GuestHeartbeatAction_To_v1alpha1_GuestHeartbeatAction(in *v1alpha2.GuestHeartbeatAction, out *GuestHeartbeatAction, s conversion.Scope) error { - return autoConvert_v1alpha2_GuestHeartbeatAction_To_v1alpha1_GuestHeartbeatAction(in, out, s) +// Convert_v1alpha3_GuestHeartbeatAction_To_v1alpha1_GuestHeartbeatAction is an autogenerated conversion function. +func Convert_v1alpha3_GuestHeartbeatAction_To_v1alpha1_GuestHeartbeatAction(in *v1alpha3.GuestHeartbeatAction, out *GuestHeartbeatAction, s conversion.Scope) error { + return autoConvert_v1alpha3_GuestHeartbeatAction_To_v1alpha1_GuestHeartbeatAction(in, out, s) } -func autoConvert_v1alpha1_InstanceStorage_To_v1alpha2_InstanceStorage(in *InstanceStorage, out *v1alpha2.InstanceStorage, s conversion.Scope) error { +func autoConvert_v1alpha1_InstanceStorage_To_v1alpha3_InstanceStorage(in *InstanceStorage, out *v1alpha3.InstanceStorage, s conversion.Scope) error { out.StorageClass = in.StorageClass - out.Volumes = *(*[]v1alpha2.InstanceStorageVolume)(unsafe.Pointer(&in.Volumes)) + out.Volumes = *(*[]v1alpha3.InstanceStorageVolume)(unsafe.Pointer(&in.Volumes)) return nil } -// Convert_v1alpha1_InstanceStorage_To_v1alpha2_InstanceStorage is an autogenerated conversion function. -func Convert_v1alpha1_InstanceStorage_To_v1alpha2_InstanceStorage(in *InstanceStorage, out *v1alpha2.InstanceStorage, s conversion.Scope) error { - return autoConvert_v1alpha1_InstanceStorage_To_v1alpha2_InstanceStorage(in, out, s) +// Convert_v1alpha1_InstanceStorage_To_v1alpha3_InstanceStorage is an autogenerated conversion function. +func Convert_v1alpha1_InstanceStorage_To_v1alpha3_InstanceStorage(in *InstanceStorage, out *v1alpha3.InstanceStorage, s conversion.Scope) error { + return autoConvert_v1alpha1_InstanceStorage_To_v1alpha3_InstanceStorage(in, out, s) } -func autoConvert_v1alpha2_InstanceStorage_To_v1alpha1_InstanceStorage(in *v1alpha2.InstanceStorage, out *InstanceStorage, s conversion.Scope) error { +func autoConvert_v1alpha3_InstanceStorage_To_v1alpha1_InstanceStorage(in *v1alpha3.InstanceStorage, out *InstanceStorage, s conversion.Scope) error { out.StorageClass = in.StorageClass out.Volumes = *(*[]InstanceStorageVolume)(unsafe.Pointer(&in.Volumes)) return nil } -// Convert_v1alpha2_InstanceStorage_To_v1alpha1_InstanceStorage is an autogenerated conversion function. -func Convert_v1alpha2_InstanceStorage_To_v1alpha1_InstanceStorage(in *v1alpha2.InstanceStorage, out *InstanceStorage, s conversion.Scope) error { - return autoConvert_v1alpha2_InstanceStorage_To_v1alpha1_InstanceStorage(in, out, s) +// Convert_v1alpha3_InstanceStorage_To_v1alpha1_InstanceStorage is an autogenerated conversion function. +func Convert_v1alpha3_InstanceStorage_To_v1alpha1_InstanceStorage(in *v1alpha3.InstanceStorage, out *InstanceStorage, s conversion.Scope) error { + return autoConvert_v1alpha3_InstanceStorage_To_v1alpha1_InstanceStorage(in, out, s) } -func autoConvert_v1alpha1_InstanceStorageVolume_To_v1alpha2_InstanceStorageVolume(in *InstanceStorageVolume, out *v1alpha2.InstanceStorageVolume, s conversion.Scope) error { +func autoConvert_v1alpha1_InstanceStorageVolume_To_v1alpha3_InstanceStorageVolume(in *InstanceStorageVolume, out *v1alpha3.InstanceStorageVolume, s conversion.Scope) error { out.Size = in.Size return nil } -// Convert_v1alpha1_InstanceStorageVolume_To_v1alpha2_InstanceStorageVolume is an autogenerated conversion function. -func Convert_v1alpha1_InstanceStorageVolume_To_v1alpha2_InstanceStorageVolume(in *InstanceStorageVolume, out *v1alpha2.InstanceStorageVolume, s conversion.Scope) error { - return autoConvert_v1alpha1_InstanceStorageVolume_To_v1alpha2_InstanceStorageVolume(in, out, s) +// Convert_v1alpha1_InstanceStorageVolume_To_v1alpha3_InstanceStorageVolume is an autogenerated conversion function. +func Convert_v1alpha1_InstanceStorageVolume_To_v1alpha3_InstanceStorageVolume(in *InstanceStorageVolume, out *v1alpha3.InstanceStorageVolume, s conversion.Scope) error { + return autoConvert_v1alpha1_InstanceStorageVolume_To_v1alpha3_InstanceStorageVolume(in, out, s) } -func autoConvert_v1alpha2_InstanceStorageVolume_To_v1alpha1_InstanceStorageVolume(in *v1alpha2.InstanceStorageVolume, out *InstanceStorageVolume, s conversion.Scope) error { +func autoConvert_v1alpha3_InstanceStorageVolume_To_v1alpha1_InstanceStorageVolume(in *v1alpha3.InstanceStorageVolume, out *InstanceStorageVolume, s conversion.Scope) error { out.Size = in.Size return nil } -// Convert_v1alpha2_InstanceStorageVolume_To_v1alpha1_InstanceStorageVolume is an autogenerated conversion function. -func Convert_v1alpha2_InstanceStorageVolume_To_v1alpha1_InstanceStorageVolume(in *v1alpha2.InstanceStorageVolume, out *InstanceStorageVolume, s conversion.Scope) error { - return autoConvert_v1alpha2_InstanceStorageVolume_To_v1alpha1_InstanceStorageVolume(in, out, s) +// Convert_v1alpha3_InstanceStorageVolume_To_v1alpha1_InstanceStorageVolume is an autogenerated conversion function. +func Convert_v1alpha3_InstanceStorageVolume_To_v1alpha1_InstanceStorageVolume(in *v1alpha3.InstanceStorageVolume, out *InstanceStorageVolume, s conversion.Scope) error { + return autoConvert_v1alpha3_InstanceStorageVolume_To_v1alpha1_InstanceStorageVolume(in, out, s) } -func autoConvert_v1alpha1_InstanceVolumeClaimVolumeSource_To_v1alpha2_InstanceVolumeClaimVolumeSource(in *InstanceVolumeClaimVolumeSource, out *v1alpha2.InstanceVolumeClaimVolumeSource, s conversion.Scope) error { +func autoConvert_v1alpha1_InstanceVolumeClaimVolumeSource_To_v1alpha3_InstanceVolumeClaimVolumeSource(in *InstanceVolumeClaimVolumeSource, out *v1alpha3.InstanceVolumeClaimVolumeSource, s conversion.Scope) error { out.StorageClass = in.StorageClass out.Size = in.Size return nil } -// Convert_v1alpha1_InstanceVolumeClaimVolumeSource_To_v1alpha2_InstanceVolumeClaimVolumeSource is an autogenerated conversion function. -func Convert_v1alpha1_InstanceVolumeClaimVolumeSource_To_v1alpha2_InstanceVolumeClaimVolumeSource(in *InstanceVolumeClaimVolumeSource, out *v1alpha2.InstanceVolumeClaimVolumeSource, s conversion.Scope) error { - return autoConvert_v1alpha1_InstanceVolumeClaimVolumeSource_To_v1alpha2_InstanceVolumeClaimVolumeSource(in, out, s) +// Convert_v1alpha1_InstanceVolumeClaimVolumeSource_To_v1alpha3_InstanceVolumeClaimVolumeSource is an autogenerated conversion function. +func Convert_v1alpha1_InstanceVolumeClaimVolumeSource_To_v1alpha3_InstanceVolumeClaimVolumeSource(in *InstanceVolumeClaimVolumeSource, out *v1alpha3.InstanceVolumeClaimVolumeSource, s conversion.Scope) error { + return autoConvert_v1alpha1_InstanceVolumeClaimVolumeSource_To_v1alpha3_InstanceVolumeClaimVolumeSource(in, out, s) } -func autoConvert_v1alpha2_InstanceVolumeClaimVolumeSource_To_v1alpha1_InstanceVolumeClaimVolumeSource(in *v1alpha2.InstanceVolumeClaimVolumeSource, out *InstanceVolumeClaimVolumeSource, s conversion.Scope) error { +func autoConvert_v1alpha3_InstanceVolumeClaimVolumeSource_To_v1alpha1_InstanceVolumeClaimVolumeSource(in *v1alpha3.InstanceVolumeClaimVolumeSource, out *InstanceVolumeClaimVolumeSource, s conversion.Scope) error { out.StorageClass = in.StorageClass out.Size = in.Size return nil } -// Convert_v1alpha2_InstanceVolumeClaimVolumeSource_To_v1alpha1_InstanceVolumeClaimVolumeSource is an autogenerated conversion function. -func Convert_v1alpha2_InstanceVolumeClaimVolumeSource_To_v1alpha1_InstanceVolumeClaimVolumeSource(in *v1alpha2.InstanceVolumeClaimVolumeSource, out *InstanceVolumeClaimVolumeSource, s conversion.Scope) error { - return autoConvert_v1alpha2_InstanceVolumeClaimVolumeSource_To_v1alpha1_InstanceVolumeClaimVolumeSource(in, out, s) +// Convert_v1alpha3_InstanceVolumeClaimVolumeSource_To_v1alpha1_InstanceVolumeClaimVolumeSource is an autogenerated conversion function. +func Convert_v1alpha3_InstanceVolumeClaimVolumeSource_To_v1alpha1_InstanceVolumeClaimVolumeSource(in *v1alpha3.InstanceVolumeClaimVolumeSource, out *InstanceVolumeClaimVolumeSource, s conversion.Scope) error { + return autoConvert_v1alpha3_InstanceVolumeClaimVolumeSource_To_v1alpha1_InstanceVolumeClaimVolumeSource(in, out, s) } -func autoConvert_v1alpha1_LoadBalancerIngress_To_v1alpha2_LoadBalancerIngress(in *LoadBalancerIngress, out *v1alpha2.LoadBalancerIngress, s conversion.Scope) error { +func autoConvert_v1alpha1_LoadBalancerIngress_To_v1alpha3_LoadBalancerIngress(in *LoadBalancerIngress, out *v1alpha3.LoadBalancerIngress, s conversion.Scope) error { out.IP = in.IP out.Hostname = in.Hostname return nil } -// Convert_v1alpha1_LoadBalancerIngress_To_v1alpha2_LoadBalancerIngress is an autogenerated conversion function. -func Convert_v1alpha1_LoadBalancerIngress_To_v1alpha2_LoadBalancerIngress(in *LoadBalancerIngress, out *v1alpha2.LoadBalancerIngress, s conversion.Scope) error { - return autoConvert_v1alpha1_LoadBalancerIngress_To_v1alpha2_LoadBalancerIngress(in, out, s) +// Convert_v1alpha1_LoadBalancerIngress_To_v1alpha3_LoadBalancerIngress is an autogenerated conversion function. +func Convert_v1alpha1_LoadBalancerIngress_To_v1alpha3_LoadBalancerIngress(in *LoadBalancerIngress, out *v1alpha3.LoadBalancerIngress, s conversion.Scope) error { + return autoConvert_v1alpha1_LoadBalancerIngress_To_v1alpha3_LoadBalancerIngress(in, out, s) } -func autoConvert_v1alpha2_LoadBalancerIngress_To_v1alpha1_LoadBalancerIngress(in *v1alpha2.LoadBalancerIngress, out *LoadBalancerIngress, s conversion.Scope) error { +func autoConvert_v1alpha3_LoadBalancerIngress_To_v1alpha1_LoadBalancerIngress(in *v1alpha3.LoadBalancerIngress, out *LoadBalancerIngress, s conversion.Scope) error { out.IP = in.IP out.Hostname = in.Hostname return nil } -// Convert_v1alpha2_LoadBalancerIngress_To_v1alpha1_LoadBalancerIngress is an autogenerated conversion function. -func Convert_v1alpha2_LoadBalancerIngress_To_v1alpha1_LoadBalancerIngress(in *v1alpha2.LoadBalancerIngress, out *LoadBalancerIngress, s conversion.Scope) error { - return autoConvert_v1alpha2_LoadBalancerIngress_To_v1alpha1_LoadBalancerIngress(in, out, s) +// Convert_v1alpha3_LoadBalancerIngress_To_v1alpha1_LoadBalancerIngress is an autogenerated conversion function. +func Convert_v1alpha3_LoadBalancerIngress_To_v1alpha1_LoadBalancerIngress(in *v1alpha3.LoadBalancerIngress, out *LoadBalancerIngress, s conversion.Scope) error { + return autoConvert_v1alpha3_LoadBalancerIngress_To_v1alpha1_LoadBalancerIngress(in, out, s) } -func autoConvert_v1alpha1_LoadBalancerStatus_To_v1alpha2_LoadBalancerStatus(in *LoadBalancerStatus, out *v1alpha2.LoadBalancerStatus, s conversion.Scope) error { - out.Ingress = *(*[]v1alpha2.LoadBalancerIngress)(unsafe.Pointer(&in.Ingress)) +func autoConvert_v1alpha1_LoadBalancerStatus_To_v1alpha3_LoadBalancerStatus(in *LoadBalancerStatus, out *v1alpha3.LoadBalancerStatus, s conversion.Scope) error { + out.Ingress = *(*[]v1alpha3.LoadBalancerIngress)(unsafe.Pointer(&in.Ingress)) return nil } -// Convert_v1alpha1_LoadBalancerStatus_To_v1alpha2_LoadBalancerStatus is an autogenerated conversion function. -func Convert_v1alpha1_LoadBalancerStatus_To_v1alpha2_LoadBalancerStatus(in *LoadBalancerStatus, out *v1alpha2.LoadBalancerStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_LoadBalancerStatus_To_v1alpha2_LoadBalancerStatus(in, out, s) +// Convert_v1alpha1_LoadBalancerStatus_To_v1alpha3_LoadBalancerStatus is an autogenerated conversion function. +func Convert_v1alpha1_LoadBalancerStatus_To_v1alpha3_LoadBalancerStatus(in *LoadBalancerStatus, out *v1alpha3.LoadBalancerStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_LoadBalancerStatus_To_v1alpha3_LoadBalancerStatus(in, out, s) } -func autoConvert_v1alpha2_LoadBalancerStatus_To_v1alpha1_LoadBalancerStatus(in *v1alpha2.LoadBalancerStatus, out *LoadBalancerStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_LoadBalancerStatus_To_v1alpha1_LoadBalancerStatus(in *v1alpha3.LoadBalancerStatus, out *LoadBalancerStatus, s conversion.Scope) error { out.Ingress = *(*[]LoadBalancerIngress)(unsafe.Pointer(&in.Ingress)) return nil } -// Convert_v1alpha2_LoadBalancerStatus_To_v1alpha1_LoadBalancerStatus is an autogenerated conversion function. -func Convert_v1alpha2_LoadBalancerStatus_To_v1alpha1_LoadBalancerStatus(in *v1alpha2.LoadBalancerStatus, out *LoadBalancerStatus, s conversion.Scope) error { - return autoConvert_v1alpha2_LoadBalancerStatus_To_v1alpha1_LoadBalancerStatus(in, out, s) +// Convert_v1alpha3_LoadBalancerStatus_To_v1alpha1_LoadBalancerStatus is an autogenerated conversion function. +func Convert_v1alpha3_LoadBalancerStatus_To_v1alpha1_LoadBalancerStatus(in *v1alpha3.LoadBalancerStatus, out *LoadBalancerStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_LoadBalancerStatus_To_v1alpha1_LoadBalancerStatus(in, out, s) } -func autoConvert_v1alpha1_NetworkDeviceStatus_To_v1alpha2_NetworkDeviceStatus(in *NetworkDeviceStatus, out *v1alpha2.NetworkDeviceStatus, s conversion.Scope) error { +func autoConvert_v1alpha1_NetworkDeviceStatus_To_v1alpha3_NetworkDeviceStatus(in *NetworkDeviceStatus, out *v1alpha3.NetworkDeviceStatus, s conversion.Scope) error { out.Gateway4 = in.Gateway4 out.MacAddress = in.MacAddress out.IPAddresses = *(*[]string)(unsafe.Pointer(&in.IPAddresses)) return nil } -// Convert_v1alpha1_NetworkDeviceStatus_To_v1alpha2_NetworkDeviceStatus is an autogenerated conversion function. -func Convert_v1alpha1_NetworkDeviceStatus_To_v1alpha2_NetworkDeviceStatus(in *NetworkDeviceStatus, out *v1alpha2.NetworkDeviceStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_NetworkDeviceStatus_To_v1alpha2_NetworkDeviceStatus(in, out, s) +// Convert_v1alpha1_NetworkDeviceStatus_To_v1alpha3_NetworkDeviceStatus is an autogenerated conversion function. +func Convert_v1alpha1_NetworkDeviceStatus_To_v1alpha3_NetworkDeviceStatus(in *NetworkDeviceStatus, out *v1alpha3.NetworkDeviceStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_NetworkDeviceStatus_To_v1alpha3_NetworkDeviceStatus(in, out, s) } -func autoConvert_v1alpha2_NetworkDeviceStatus_To_v1alpha1_NetworkDeviceStatus(in *v1alpha2.NetworkDeviceStatus, out *NetworkDeviceStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_NetworkDeviceStatus_To_v1alpha1_NetworkDeviceStatus(in *v1alpha3.NetworkDeviceStatus, out *NetworkDeviceStatus, s conversion.Scope) error { out.Gateway4 = in.Gateway4 out.MacAddress = in.MacAddress out.IPAddresses = *(*[]string)(unsafe.Pointer(&in.IPAddresses)) return nil } -// Convert_v1alpha2_NetworkDeviceStatus_To_v1alpha1_NetworkDeviceStatus is an autogenerated conversion function. -func Convert_v1alpha2_NetworkDeviceStatus_To_v1alpha1_NetworkDeviceStatus(in *v1alpha2.NetworkDeviceStatus, out *NetworkDeviceStatus, s conversion.Scope) error { - return autoConvert_v1alpha2_NetworkDeviceStatus_To_v1alpha1_NetworkDeviceStatus(in, out, s) +// Convert_v1alpha3_NetworkDeviceStatus_To_v1alpha1_NetworkDeviceStatus is an autogenerated conversion function. +func Convert_v1alpha3_NetworkDeviceStatus_To_v1alpha1_NetworkDeviceStatus(in *v1alpha3.NetworkDeviceStatus, out *NetworkDeviceStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_NetworkDeviceStatus_To_v1alpha1_NetworkDeviceStatus(in, out, s) } -func autoConvert_v1alpha1_NetworkStatus_To_v1alpha2_NetworkStatus(in *NetworkStatus, out *v1alpha2.NetworkStatus, s conversion.Scope) error { - out.Devices = *(*[]v1alpha2.NetworkDeviceStatus)(unsafe.Pointer(&in.Devices)) +func autoConvert_v1alpha1_NetworkStatus_To_v1alpha3_NetworkStatus(in *NetworkStatus, out *v1alpha3.NetworkStatus, s conversion.Scope) error { + out.Devices = *(*[]v1alpha3.NetworkDeviceStatus)(unsafe.Pointer(&in.Devices)) out.Nameservers = *(*[]string)(unsafe.Pointer(&in.Nameservers)) return nil } -// Convert_v1alpha1_NetworkStatus_To_v1alpha2_NetworkStatus is an autogenerated conversion function. -func Convert_v1alpha1_NetworkStatus_To_v1alpha2_NetworkStatus(in *NetworkStatus, out *v1alpha2.NetworkStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_NetworkStatus_To_v1alpha2_NetworkStatus(in, out, s) +// Convert_v1alpha1_NetworkStatus_To_v1alpha3_NetworkStatus is an autogenerated conversion function. +func Convert_v1alpha1_NetworkStatus_To_v1alpha3_NetworkStatus(in *NetworkStatus, out *v1alpha3.NetworkStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_NetworkStatus_To_v1alpha3_NetworkStatus(in, out, s) } -func autoConvert_v1alpha2_NetworkStatus_To_v1alpha1_NetworkStatus(in *v1alpha2.NetworkStatus, out *NetworkStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_NetworkStatus_To_v1alpha1_NetworkStatus(in *v1alpha3.NetworkStatus, out *NetworkStatus, s conversion.Scope) error { out.Devices = *(*[]NetworkDeviceStatus)(unsafe.Pointer(&in.Devices)) out.Nameservers = *(*[]string)(unsafe.Pointer(&in.Nameservers)) return nil } -// Convert_v1alpha2_NetworkStatus_To_v1alpha1_NetworkStatus is an autogenerated conversion function. -func Convert_v1alpha2_NetworkStatus_To_v1alpha1_NetworkStatus(in *v1alpha2.NetworkStatus, out *NetworkStatus, s conversion.Scope) error { - return autoConvert_v1alpha2_NetworkStatus_To_v1alpha1_NetworkStatus(in, out, s) +// Convert_v1alpha3_NetworkStatus_To_v1alpha1_NetworkStatus is an autogenerated conversion function. +func Convert_v1alpha3_NetworkStatus_To_v1alpha1_NetworkStatus(in *v1alpha3.NetworkStatus, out *NetworkStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_NetworkStatus_To_v1alpha1_NetworkStatus(in, out, s) } -func autoConvert_v1alpha1_PersistentVolumeClaimVolumeSource_To_v1alpha2_PersistentVolumeClaimVolumeSource(in *PersistentVolumeClaimVolumeSource, out *v1alpha2.PersistentVolumeClaimVolumeSource, s conversion.Scope) error { +func autoConvert_v1alpha1_PersistentVolumeClaimVolumeSource_To_v1alpha3_PersistentVolumeClaimVolumeSource(in *PersistentVolumeClaimVolumeSource, out *v1alpha3.PersistentVolumeClaimVolumeSource, s conversion.Scope) error { out.PersistentVolumeClaimVolumeSource = in.PersistentVolumeClaimVolumeSource - out.InstanceVolumeClaim = (*v1alpha2.InstanceVolumeClaimVolumeSource)(unsafe.Pointer(in.InstanceVolumeClaim)) + out.InstanceVolumeClaim = (*v1alpha3.InstanceVolumeClaimVolumeSource)(unsafe.Pointer(in.InstanceVolumeClaim)) return nil } -// Convert_v1alpha1_PersistentVolumeClaimVolumeSource_To_v1alpha2_PersistentVolumeClaimVolumeSource is an autogenerated conversion function. -func Convert_v1alpha1_PersistentVolumeClaimVolumeSource_To_v1alpha2_PersistentVolumeClaimVolumeSource(in *PersistentVolumeClaimVolumeSource, out *v1alpha2.PersistentVolumeClaimVolumeSource, s conversion.Scope) error { - return autoConvert_v1alpha1_PersistentVolumeClaimVolumeSource_To_v1alpha2_PersistentVolumeClaimVolumeSource(in, out, s) +// Convert_v1alpha1_PersistentVolumeClaimVolumeSource_To_v1alpha3_PersistentVolumeClaimVolumeSource is an autogenerated conversion function. +func Convert_v1alpha1_PersistentVolumeClaimVolumeSource_To_v1alpha3_PersistentVolumeClaimVolumeSource(in *PersistentVolumeClaimVolumeSource, out *v1alpha3.PersistentVolumeClaimVolumeSource, s conversion.Scope) error { + return autoConvert_v1alpha1_PersistentVolumeClaimVolumeSource_To_v1alpha3_PersistentVolumeClaimVolumeSource(in, out, s) } -func autoConvert_v1alpha2_PersistentVolumeClaimVolumeSource_To_v1alpha1_PersistentVolumeClaimVolumeSource(in *v1alpha2.PersistentVolumeClaimVolumeSource, out *PersistentVolumeClaimVolumeSource, s conversion.Scope) error { +func autoConvert_v1alpha3_PersistentVolumeClaimVolumeSource_To_v1alpha1_PersistentVolumeClaimVolumeSource(in *v1alpha3.PersistentVolumeClaimVolumeSource, out *PersistentVolumeClaimVolumeSource, s conversion.Scope) error { out.PersistentVolumeClaimVolumeSource = in.PersistentVolumeClaimVolumeSource out.InstanceVolumeClaim = (*InstanceVolumeClaimVolumeSource)(unsafe.Pointer(in.InstanceVolumeClaim)) return nil } -// Convert_v1alpha2_PersistentVolumeClaimVolumeSource_To_v1alpha1_PersistentVolumeClaimVolumeSource is an autogenerated conversion function. -func Convert_v1alpha2_PersistentVolumeClaimVolumeSource_To_v1alpha1_PersistentVolumeClaimVolumeSource(in *v1alpha2.PersistentVolumeClaimVolumeSource, out *PersistentVolumeClaimVolumeSource, s conversion.Scope) error { - return autoConvert_v1alpha2_PersistentVolumeClaimVolumeSource_To_v1alpha1_PersistentVolumeClaimVolumeSource(in, out, s) +// Convert_v1alpha3_PersistentVolumeClaimVolumeSource_To_v1alpha1_PersistentVolumeClaimVolumeSource is an autogenerated conversion function. +func Convert_v1alpha3_PersistentVolumeClaimVolumeSource_To_v1alpha1_PersistentVolumeClaimVolumeSource(in *v1alpha3.PersistentVolumeClaimVolumeSource, out *PersistentVolumeClaimVolumeSource, s conversion.Scope) error { + return autoConvert_v1alpha3_PersistentVolumeClaimVolumeSource_To_v1alpha1_PersistentVolumeClaimVolumeSource(in, out, s) } -func autoConvert_v1alpha1_ResourcePoolSpec_To_v1alpha2_ResourcePoolSpec(in *ResourcePoolSpec, out *v1alpha2.ResourcePoolSpec, s conversion.Scope) error { +func autoConvert_v1alpha1_ResourcePoolSpec_To_v1alpha3_ResourcePoolSpec(in *ResourcePoolSpec, out *v1alpha3.ResourcePoolSpec, s conversion.Scope) error { out.Name = in.Name - if err := Convert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(&in.Reservations, &out.Reservations, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(&in.Reservations, &out.Reservations, s); err != nil { return err } - if err := Convert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(&in.Limits, &out.Limits, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(&in.Limits, &out.Limits, s); err != nil { return err } return nil } -// Convert_v1alpha1_ResourcePoolSpec_To_v1alpha2_ResourcePoolSpec is an autogenerated conversion function. -func Convert_v1alpha1_ResourcePoolSpec_To_v1alpha2_ResourcePoolSpec(in *ResourcePoolSpec, out *v1alpha2.ResourcePoolSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_ResourcePoolSpec_To_v1alpha2_ResourcePoolSpec(in, out, s) +// Convert_v1alpha1_ResourcePoolSpec_To_v1alpha3_ResourcePoolSpec is an autogenerated conversion function. +func Convert_v1alpha1_ResourcePoolSpec_To_v1alpha3_ResourcePoolSpec(in *ResourcePoolSpec, out *v1alpha3.ResourcePoolSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_ResourcePoolSpec_To_v1alpha3_ResourcePoolSpec(in, out, s) } -func autoConvert_v1alpha2_ResourcePoolSpec_To_v1alpha1_ResourcePoolSpec(in *v1alpha2.ResourcePoolSpec, out *ResourcePoolSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_ResourcePoolSpec_To_v1alpha1_ResourcePoolSpec(in *v1alpha3.ResourcePoolSpec, out *ResourcePoolSpec, s conversion.Scope) error { out.Name = in.Name - if err := Convert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(&in.Reservations, &out.Reservations, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(&in.Reservations, &out.Reservations, s); err != nil { return err } - if err := Convert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(&in.Limits, &out.Limits, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(&in.Limits, &out.Limits, s); err != nil { return err } return nil } -// Convert_v1alpha2_ResourcePoolSpec_To_v1alpha1_ResourcePoolSpec is an autogenerated conversion function. -func Convert_v1alpha2_ResourcePoolSpec_To_v1alpha1_ResourcePoolSpec(in *v1alpha2.ResourcePoolSpec, out *ResourcePoolSpec, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourcePoolSpec_To_v1alpha1_ResourcePoolSpec(in, out, s) +// Convert_v1alpha3_ResourcePoolSpec_To_v1alpha1_ResourcePoolSpec is an autogenerated conversion function. +func Convert_v1alpha3_ResourcePoolSpec_To_v1alpha1_ResourcePoolSpec(in *v1alpha3.ResourcePoolSpec, out *ResourcePoolSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourcePoolSpec_To_v1alpha1_ResourcePoolSpec(in, out, s) } -func autoConvert_v1alpha1_TCPSocketAction_To_v1alpha2_TCPSocketAction(in *TCPSocketAction, out *v1alpha2.TCPSocketAction, s conversion.Scope) error { +func autoConvert_v1alpha1_TCPSocketAction_To_v1alpha3_TCPSocketAction(in *TCPSocketAction, out *v1alpha3.TCPSocketAction, s conversion.Scope) error { out.Port = in.Port out.Host = in.Host return nil } -// Convert_v1alpha1_TCPSocketAction_To_v1alpha2_TCPSocketAction is an autogenerated conversion function. -func Convert_v1alpha1_TCPSocketAction_To_v1alpha2_TCPSocketAction(in *TCPSocketAction, out *v1alpha2.TCPSocketAction, s conversion.Scope) error { - return autoConvert_v1alpha1_TCPSocketAction_To_v1alpha2_TCPSocketAction(in, out, s) +// Convert_v1alpha1_TCPSocketAction_To_v1alpha3_TCPSocketAction is an autogenerated conversion function. +func Convert_v1alpha1_TCPSocketAction_To_v1alpha3_TCPSocketAction(in *TCPSocketAction, out *v1alpha3.TCPSocketAction, s conversion.Scope) error { + return autoConvert_v1alpha1_TCPSocketAction_To_v1alpha3_TCPSocketAction(in, out, s) } -func autoConvert_v1alpha2_TCPSocketAction_To_v1alpha1_TCPSocketAction(in *v1alpha2.TCPSocketAction, out *TCPSocketAction, s conversion.Scope) error { +func autoConvert_v1alpha3_TCPSocketAction_To_v1alpha1_TCPSocketAction(in *v1alpha3.TCPSocketAction, out *TCPSocketAction, s conversion.Scope) error { out.Port = in.Port out.Host = in.Host return nil } -// Convert_v1alpha2_TCPSocketAction_To_v1alpha1_TCPSocketAction is an autogenerated conversion function. -func Convert_v1alpha2_TCPSocketAction_To_v1alpha1_TCPSocketAction(in *v1alpha2.TCPSocketAction, out *TCPSocketAction, s conversion.Scope) error { - return autoConvert_v1alpha2_TCPSocketAction_To_v1alpha1_TCPSocketAction(in, out, s) +// Convert_v1alpha3_TCPSocketAction_To_v1alpha1_TCPSocketAction is an autogenerated conversion function. +func Convert_v1alpha3_TCPSocketAction_To_v1alpha1_TCPSocketAction(in *v1alpha3.TCPSocketAction, out *TCPSocketAction, s conversion.Scope) error { + return autoConvert_v1alpha3_TCPSocketAction_To_v1alpha1_TCPSocketAction(in, out, s) } -func autoConvert_v1alpha1_VGPUDevice_To_v1alpha2_VGPUDevice(in *VGPUDevice, out *v1alpha2.VGPUDevice, s conversion.Scope) error { +func autoConvert_v1alpha1_VGPUDevice_To_v1alpha3_VGPUDevice(in *VGPUDevice, out *v1alpha3.VGPUDevice, s conversion.Scope) error { out.ProfileName = in.ProfileName return nil } -// Convert_v1alpha1_VGPUDevice_To_v1alpha2_VGPUDevice is an autogenerated conversion function. -func Convert_v1alpha1_VGPUDevice_To_v1alpha2_VGPUDevice(in *VGPUDevice, out *v1alpha2.VGPUDevice, s conversion.Scope) error { - return autoConvert_v1alpha1_VGPUDevice_To_v1alpha2_VGPUDevice(in, out, s) +// Convert_v1alpha1_VGPUDevice_To_v1alpha3_VGPUDevice is an autogenerated conversion function. +func Convert_v1alpha1_VGPUDevice_To_v1alpha3_VGPUDevice(in *VGPUDevice, out *v1alpha3.VGPUDevice, s conversion.Scope) error { + return autoConvert_v1alpha1_VGPUDevice_To_v1alpha3_VGPUDevice(in, out, s) } -func autoConvert_v1alpha2_VGPUDevice_To_v1alpha1_VGPUDevice(in *v1alpha2.VGPUDevice, out *VGPUDevice, s conversion.Scope) error { +func autoConvert_v1alpha3_VGPUDevice_To_v1alpha1_VGPUDevice(in *v1alpha3.VGPUDevice, out *VGPUDevice, s conversion.Scope) error { out.ProfileName = in.ProfileName return nil } -// Convert_v1alpha2_VGPUDevice_To_v1alpha1_VGPUDevice is an autogenerated conversion function. -func Convert_v1alpha2_VGPUDevice_To_v1alpha1_VGPUDevice(in *v1alpha2.VGPUDevice, out *VGPUDevice, s conversion.Scope) error { - return autoConvert_v1alpha2_VGPUDevice_To_v1alpha1_VGPUDevice(in, out, s) +// Convert_v1alpha3_VGPUDevice_To_v1alpha1_VGPUDevice is an autogenerated conversion function. +func Convert_v1alpha3_VGPUDevice_To_v1alpha1_VGPUDevice(in *v1alpha3.VGPUDevice, out *VGPUDevice, s conversion.Scope) error { + return autoConvert_v1alpha3_VGPUDevice_To_v1alpha1_VGPUDevice(in, out, s) } -func autoConvert_v1alpha1_VirtualDevices_To_v1alpha2_VirtualDevices(in *VirtualDevices, out *v1alpha2.VirtualDevices, s conversion.Scope) error { - out.VGPUDevices = *(*[]v1alpha2.VGPUDevice)(unsafe.Pointer(&in.VGPUDevices)) +func autoConvert_v1alpha1_VirtualDevices_To_v1alpha3_VirtualDevices(in *VirtualDevices, out *v1alpha3.VirtualDevices, s conversion.Scope) error { + out.VGPUDevices = *(*[]v1alpha3.VGPUDevice)(unsafe.Pointer(&in.VGPUDevices)) if in.DynamicDirectPathIODevices != nil { in, out := &in.DynamicDirectPathIODevices, &out.DynamicDirectPathIODevices - *out = make([]v1alpha2.DynamicDirectPathIODevice, len(*in)) + *out = make([]v1alpha3.DynamicDirectPathIODevice, len(*in)) for i := range *in { - if err := Convert_v1alpha1_DynamicDirectPathIODevice_To_v1alpha2_DynamicDirectPathIODevice(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha1_DynamicDirectPathIODevice_To_v1alpha3_DynamicDirectPathIODevice(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1002,18 +991,18 @@ func autoConvert_v1alpha1_VirtualDevices_To_v1alpha2_VirtualDevices(in *VirtualD return nil } -// Convert_v1alpha1_VirtualDevices_To_v1alpha2_VirtualDevices is an autogenerated conversion function. -func Convert_v1alpha1_VirtualDevices_To_v1alpha2_VirtualDevices(in *VirtualDevices, out *v1alpha2.VirtualDevices, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualDevices_To_v1alpha2_VirtualDevices(in, out, s) +// Convert_v1alpha1_VirtualDevices_To_v1alpha3_VirtualDevices is an autogenerated conversion function. +func Convert_v1alpha1_VirtualDevices_To_v1alpha3_VirtualDevices(in *VirtualDevices, out *v1alpha3.VirtualDevices, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualDevices_To_v1alpha3_VirtualDevices(in, out, s) } -func autoConvert_v1alpha2_VirtualDevices_To_v1alpha1_VirtualDevices(in *v1alpha2.VirtualDevices, out *VirtualDevices, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualDevices_To_v1alpha1_VirtualDevices(in *v1alpha3.VirtualDevices, out *VirtualDevices, s conversion.Scope) error { out.VGPUDevices = *(*[]VGPUDevice)(unsafe.Pointer(&in.VGPUDevices)) if in.DynamicDirectPathIODevices != nil { in, out := &in.DynamicDirectPathIODevices, &out.DynamicDirectPathIODevices *out = make([]DynamicDirectPathIODevice, len(*in)) for i := range *in { - if err := Convert_v1alpha2_DynamicDirectPathIODevice_To_v1alpha1_DynamicDirectPathIODevice(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_DynamicDirectPathIODevice_To_v1alpha1_DynamicDirectPathIODevice(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1023,116 +1012,116 @@ func autoConvert_v1alpha2_VirtualDevices_To_v1alpha1_VirtualDevices(in *v1alpha2 return nil } -// Convert_v1alpha2_VirtualDevices_To_v1alpha1_VirtualDevices is an autogenerated conversion function. -func Convert_v1alpha2_VirtualDevices_To_v1alpha1_VirtualDevices(in *v1alpha2.VirtualDevices, out *VirtualDevices, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualDevices_To_v1alpha1_VirtualDevices(in, out, s) +// Convert_v1alpha3_VirtualDevices_To_v1alpha1_VirtualDevices is an autogenerated conversion function. +func Convert_v1alpha3_VirtualDevices_To_v1alpha1_VirtualDevices(in *v1alpha3.VirtualDevices, out *VirtualDevices, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualDevices_To_v1alpha1_VirtualDevices(in, out, s) } -func autoConvert_v1alpha1_VirtualMachine_To_v1alpha2_VirtualMachine(in *VirtualMachine, out *v1alpha2.VirtualMachine, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachine_To_v1alpha3_VirtualMachine(in *VirtualMachine, out *v1alpha3.VirtualMachine, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineSpec_To_v1alpha3_VirtualMachineSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha1_VirtualMachineStatus_To_v1alpha2_VirtualMachineStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineStatus_To_v1alpha3_VirtualMachineStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha1_VirtualMachine_To_v1alpha2_VirtualMachine is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachine_To_v1alpha2_VirtualMachine(in *VirtualMachine, out *v1alpha2.VirtualMachine, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachine_To_v1alpha2_VirtualMachine(in, out, s) +// Convert_v1alpha1_VirtualMachine_To_v1alpha3_VirtualMachine is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachine_To_v1alpha3_VirtualMachine(in *VirtualMachine, out *v1alpha3.VirtualMachine, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachine_To_v1alpha3_VirtualMachine(in, out, s) } -func autoConvert_v1alpha2_VirtualMachine_To_v1alpha1_VirtualMachine(in *v1alpha2.VirtualMachine, out *VirtualMachine, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachine_To_v1alpha1_VirtualMachine(in *v1alpha3.VirtualMachine, out *VirtualMachine, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_VirtualMachineSpec_To_v1alpha1_VirtualMachineSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineSpec_To_v1alpha1_VirtualMachineSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha2_VirtualMachineStatus_To_v1alpha1_VirtualMachineStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineStatus_To_v1alpha1_VirtualMachineStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha2_VirtualMachine_To_v1alpha1_VirtualMachine is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachine_To_v1alpha1_VirtualMachine(in *v1alpha2.VirtualMachine, out *VirtualMachine, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachine_To_v1alpha1_VirtualMachine(in, out, s) +// Convert_v1alpha3_VirtualMachine_To_v1alpha1_VirtualMachine is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachine_To_v1alpha1_VirtualMachine(in *v1alpha3.VirtualMachine, out *VirtualMachine, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachine_To_v1alpha1_VirtualMachine(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineClass_To_v1alpha2_VirtualMachineClass(in *VirtualMachineClass, out *v1alpha2.VirtualMachineClass, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineClass_To_v1alpha3_VirtualMachineClass(in *VirtualMachineClass, out *v1alpha3.VirtualMachineClass, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_VirtualMachineClassSpec_To_v1alpha2_VirtualMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineClassSpec_To_v1alpha3_VirtualMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha1_VirtualMachineClassStatus_To_v1alpha2_VirtualMachineClassStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineClassStatus_To_v1alpha3_VirtualMachineClassStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha1_VirtualMachineClass_To_v1alpha2_VirtualMachineClass is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineClass_To_v1alpha2_VirtualMachineClass(in *VirtualMachineClass, out *v1alpha2.VirtualMachineClass, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineClass_To_v1alpha2_VirtualMachineClass(in, out, s) +// Convert_v1alpha1_VirtualMachineClass_To_v1alpha3_VirtualMachineClass is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineClass_To_v1alpha3_VirtualMachineClass(in *VirtualMachineClass, out *v1alpha3.VirtualMachineClass, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineClass_To_v1alpha3_VirtualMachineClass(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineClass_To_v1alpha1_VirtualMachineClass(in *v1alpha2.VirtualMachineClass, out *VirtualMachineClass, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineClass_To_v1alpha1_VirtualMachineClass(in *v1alpha3.VirtualMachineClass, out *VirtualMachineClass, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_VirtualMachineClassSpec_To_v1alpha1_VirtualMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineClassSpec_To_v1alpha1_VirtualMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha2_VirtualMachineClassStatus_To_v1alpha1_VirtualMachineClassStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineClassStatus_To_v1alpha1_VirtualMachineClassStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha2_VirtualMachineClass_To_v1alpha1_VirtualMachineClass is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineClass_To_v1alpha1_VirtualMachineClass(in *v1alpha2.VirtualMachineClass, out *VirtualMachineClass, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineClass_To_v1alpha1_VirtualMachineClass(in, out, s) +// Convert_v1alpha3_VirtualMachineClass_To_v1alpha1_VirtualMachineClass is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineClass_To_v1alpha1_VirtualMachineClass(in *v1alpha3.VirtualMachineClass, out *VirtualMachineClass, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineClass_To_v1alpha1_VirtualMachineClass(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineClassHardware_To_v1alpha2_VirtualMachineClassHardware(in *VirtualMachineClassHardware, out *v1alpha2.VirtualMachineClassHardware, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineClassHardware_To_v1alpha3_VirtualMachineClassHardware(in *VirtualMachineClassHardware, out *v1alpha3.VirtualMachineClassHardware, s conversion.Scope) error { out.Cpus = in.Cpus out.Memory = in.Memory - if err := Convert_v1alpha1_VirtualDevices_To_v1alpha2_VirtualDevices(&in.Devices, &out.Devices, s); err != nil { + if err := Convert_v1alpha1_VirtualDevices_To_v1alpha3_VirtualDevices(&in.Devices, &out.Devices, s); err != nil { return err } - if err := Convert_v1alpha1_InstanceStorage_To_v1alpha2_InstanceStorage(&in.InstanceStorage, &out.InstanceStorage, s); err != nil { + if err := Convert_v1alpha1_InstanceStorage_To_v1alpha3_InstanceStorage(&in.InstanceStorage, &out.InstanceStorage, s); err != nil { return err } return nil } -// Convert_v1alpha1_VirtualMachineClassHardware_To_v1alpha2_VirtualMachineClassHardware is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineClassHardware_To_v1alpha2_VirtualMachineClassHardware(in *VirtualMachineClassHardware, out *v1alpha2.VirtualMachineClassHardware, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineClassHardware_To_v1alpha2_VirtualMachineClassHardware(in, out, s) +// Convert_v1alpha1_VirtualMachineClassHardware_To_v1alpha3_VirtualMachineClassHardware is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineClassHardware_To_v1alpha3_VirtualMachineClassHardware(in *VirtualMachineClassHardware, out *v1alpha3.VirtualMachineClassHardware, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineClassHardware_To_v1alpha3_VirtualMachineClassHardware(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineClassHardware_To_v1alpha1_VirtualMachineClassHardware(in *v1alpha2.VirtualMachineClassHardware, out *VirtualMachineClassHardware, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineClassHardware_To_v1alpha1_VirtualMachineClassHardware(in *v1alpha3.VirtualMachineClassHardware, out *VirtualMachineClassHardware, s conversion.Scope) error { out.Cpus = in.Cpus out.Memory = in.Memory - if err := Convert_v1alpha2_VirtualDevices_To_v1alpha1_VirtualDevices(&in.Devices, &out.Devices, s); err != nil { + if err := Convert_v1alpha3_VirtualDevices_To_v1alpha1_VirtualDevices(&in.Devices, &out.Devices, s); err != nil { return err } - if err := Convert_v1alpha2_InstanceStorage_To_v1alpha1_InstanceStorage(&in.InstanceStorage, &out.InstanceStorage, s); err != nil { + if err := Convert_v1alpha3_InstanceStorage_To_v1alpha1_InstanceStorage(&in.InstanceStorage, &out.InstanceStorage, s); err != nil { return err } return nil } -// Convert_v1alpha2_VirtualMachineClassHardware_To_v1alpha1_VirtualMachineClassHardware is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineClassHardware_To_v1alpha1_VirtualMachineClassHardware(in *v1alpha2.VirtualMachineClassHardware, out *VirtualMachineClassHardware, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineClassHardware_To_v1alpha1_VirtualMachineClassHardware(in, out, s) +// Convert_v1alpha3_VirtualMachineClassHardware_To_v1alpha1_VirtualMachineClassHardware is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineClassHardware_To_v1alpha1_VirtualMachineClassHardware(in *v1alpha3.VirtualMachineClassHardware, out *VirtualMachineClassHardware, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineClassHardware_To_v1alpha1_VirtualMachineClassHardware(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineClassList_To_v1alpha2_VirtualMachineClassList(in *VirtualMachineClassList, out *v1alpha2.VirtualMachineClassList, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineClassList_To_v1alpha3_VirtualMachineClassList(in *VirtualMachineClassList, out *v1alpha3.VirtualMachineClassList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha2.VirtualMachineClass, len(*in)) + *out = make([]v1alpha3.VirtualMachineClass, len(*in)) for i := range *in { - if err := Convert_v1alpha1_VirtualMachineClass_To_v1alpha2_VirtualMachineClass(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha1_VirtualMachineClass_To_v1alpha3_VirtualMachineClass(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1142,18 +1131,18 @@ func autoConvert_v1alpha1_VirtualMachineClassList_To_v1alpha2_VirtualMachineClas return nil } -// Convert_v1alpha1_VirtualMachineClassList_To_v1alpha2_VirtualMachineClassList is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineClassList_To_v1alpha2_VirtualMachineClassList(in *VirtualMachineClassList, out *v1alpha2.VirtualMachineClassList, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineClassList_To_v1alpha2_VirtualMachineClassList(in, out, s) +// Convert_v1alpha1_VirtualMachineClassList_To_v1alpha3_VirtualMachineClassList is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineClassList_To_v1alpha3_VirtualMachineClassList(in *VirtualMachineClassList, out *v1alpha3.VirtualMachineClassList, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineClassList_To_v1alpha3_VirtualMachineClassList(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineClassList_To_v1alpha1_VirtualMachineClassList(in *v1alpha2.VirtualMachineClassList, out *VirtualMachineClassList, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineClassList_To_v1alpha1_VirtualMachineClassList(in *v1alpha3.VirtualMachineClassList, out *VirtualMachineClassList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]VirtualMachineClass, len(*in)) for i := range *in { - if err := Convert_v1alpha2_VirtualMachineClass_To_v1alpha1_VirtualMachineClass(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_VirtualMachineClass_To_v1alpha1_VirtualMachineClass(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1163,71 +1152,71 @@ func autoConvert_v1alpha2_VirtualMachineClassList_To_v1alpha1_VirtualMachineClas return nil } -// Convert_v1alpha2_VirtualMachineClassList_To_v1alpha1_VirtualMachineClassList is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineClassList_To_v1alpha1_VirtualMachineClassList(in *v1alpha2.VirtualMachineClassList, out *VirtualMachineClassList, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineClassList_To_v1alpha1_VirtualMachineClassList(in, out, s) +// Convert_v1alpha3_VirtualMachineClassList_To_v1alpha1_VirtualMachineClassList is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineClassList_To_v1alpha1_VirtualMachineClassList(in *v1alpha3.VirtualMachineClassList, out *VirtualMachineClassList, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineClassList_To_v1alpha1_VirtualMachineClassList(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineClassPolicies_To_v1alpha2_VirtualMachineClassPolicies(in *VirtualMachineClassPolicies, out *v1alpha2.VirtualMachineClassPolicies, s conversion.Scope) error { - if err := Convert_v1alpha1_VirtualMachineClassResources_To_v1alpha2_VirtualMachineClassResources(&in.Resources, &out.Resources, s); err != nil { +func autoConvert_v1alpha1_VirtualMachineClassPolicies_To_v1alpha3_VirtualMachineClassPolicies(in *VirtualMachineClassPolicies, out *v1alpha3.VirtualMachineClassPolicies, s conversion.Scope) error { + if err := Convert_v1alpha1_VirtualMachineClassResources_To_v1alpha3_VirtualMachineClassResources(&in.Resources, &out.Resources, s); err != nil { return err } return nil } -// Convert_v1alpha1_VirtualMachineClassPolicies_To_v1alpha2_VirtualMachineClassPolicies is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineClassPolicies_To_v1alpha2_VirtualMachineClassPolicies(in *VirtualMachineClassPolicies, out *v1alpha2.VirtualMachineClassPolicies, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineClassPolicies_To_v1alpha2_VirtualMachineClassPolicies(in, out, s) +// Convert_v1alpha1_VirtualMachineClassPolicies_To_v1alpha3_VirtualMachineClassPolicies is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineClassPolicies_To_v1alpha3_VirtualMachineClassPolicies(in *VirtualMachineClassPolicies, out *v1alpha3.VirtualMachineClassPolicies, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineClassPolicies_To_v1alpha3_VirtualMachineClassPolicies(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineClassPolicies_To_v1alpha1_VirtualMachineClassPolicies(in *v1alpha2.VirtualMachineClassPolicies, out *VirtualMachineClassPolicies, s conversion.Scope) error { - if err := Convert_v1alpha2_VirtualMachineClassResources_To_v1alpha1_VirtualMachineClassResources(&in.Resources, &out.Resources, s); err != nil { +func autoConvert_v1alpha3_VirtualMachineClassPolicies_To_v1alpha1_VirtualMachineClassPolicies(in *v1alpha3.VirtualMachineClassPolicies, out *VirtualMachineClassPolicies, s conversion.Scope) error { + if err := Convert_v1alpha3_VirtualMachineClassResources_To_v1alpha1_VirtualMachineClassResources(&in.Resources, &out.Resources, s); err != nil { return err } return nil } -// Convert_v1alpha2_VirtualMachineClassPolicies_To_v1alpha1_VirtualMachineClassPolicies is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineClassPolicies_To_v1alpha1_VirtualMachineClassPolicies(in *v1alpha2.VirtualMachineClassPolicies, out *VirtualMachineClassPolicies, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineClassPolicies_To_v1alpha1_VirtualMachineClassPolicies(in, out, s) +// Convert_v1alpha3_VirtualMachineClassPolicies_To_v1alpha1_VirtualMachineClassPolicies is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineClassPolicies_To_v1alpha1_VirtualMachineClassPolicies(in *v1alpha3.VirtualMachineClassPolicies, out *VirtualMachineClassPolicies, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineClassPolicies_To_v1alpha1_VirtualMachineClassPolicies(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineClassResources_To_v1alpha2_VirtualMachineClassResources(in *VirtualMachineClassResources, out *v1alpha2.VirtualMachineClassResources, s conversion.Scope) error { - if err := Convert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(&in.Requests, &out.Requests, s); err != nil { +func autoConvert_v1alpha1_VirtualMachineClassResources_To_v1alpha3_VirtualMachineClassResources(in *VirtualMachineClassResources, out *v1alpha3.VirtualMachineClassResources, s conversion.Scope) error { + if err := Convert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(&in.Requests, &out.Requests, s); err != nil { return err } - if err := Convert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(&in.Limits, &out.Limits, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(&in.Limits, &out.Limits, s); err != nil { return err } return nil } -// Convert_v1alpha1_VirtualMachineClassResources_To_v1alpha2_VirtualMachineClassResources is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineClassResources_To_v1alpha2_VirtualMachineClassResources(in *VirtualMachineClassResources, out *v1alpha2.VirtualMachineClassResources, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineClassResources_To_v1alpha2_VirtualMachineClassResources(in, out, s) +// Convert_v1alpha1_VirtualMachineClassResources_To_v1alpha3_VirtualMachineClassResources is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineClassResources_To_v1alpha3_VirtualMachineClassResources(in *VirtualMachineClassResources, out *v1alpha3.VirtualMachineClassResources, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineClassResources_To_v1alpha3_VirtualMachineClassResources(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineClassResources_To_v1alpha1_VirtualMachineClassResources(in *v1alpha2.VirtualMachineClassResources, out *VirtualMachineClassResources, s conversion.Scope) error { - if err := Convert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(&in.Requests, &out.Requests, s); err != nil { +func autoConvert_v1alpha3_VirtualMachineClassResources_To_v1alpha1_VirtualMachineClassResources(in *v1alpha3.VirtualMachineClassResources, out *VirtualMachineClassResources, s conversion.Scope) error { + if err := Convert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(&in.Requests, &out.Requests, s); err != nil { return err } - if err := Convert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(&in.Limits, &out.Limits, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(&in.Limits, &out.Limits, s); err != nil { return err } return nil } -// Convert_v1alpha2_VirtualMachineClassResources_To_v1alpha1_VirtualMachineClassResources is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineClassResources_To_v1alpha1_VirtualMachineClassResources(in *v1alpha2.VirtualMachineClassResources, out *VirtualMachineClassResources, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineClassResources_To_v1alpha1_VirtualMachineClassResources(in, out, s) +// Convert_v1alpha3_VirtualMachineClassResources_To_v1alpha1_VirtualMachineClassResources is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineClassResources_To_v1alpha1_VirtualMachineClassResources(in *v1alpha3.VirtualMachineClassResources, out *VirtualMachineClassResources, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineClassResources_To_v1alpha1_VirtualMachineClassResources(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineClassSpec_To_v1alpha2_VirtualMachineClassSpec(in *VirtualMachineClassSpec, out *v1alpha2.VirtualMachineClassSpec, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineClassSpec_To_v1alpha3_VirtualMachineClassSpec(in *VirtualMachineClassSpec, out *v1alpha3.VirtualMachineClassSpec, s conversion.Scope) error { out.ControllerName = in.ControllerName - if err := Convert_v1alpha1_VirtualMachineClassHardware_To_v1alpha2_VirtualMachineClassHardware(&in.Hardware, &out.Hardware, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineClassHardware_To_v1alpha3_VirtualMachineClassHardware(&in.Hardware, &out.Hardware, s); err != nil { return err } - if err := Convert_v1alpha1_VirtualMachineClassPolicies_To_v1alpha2_VirtualMachineClassPolicies(&in.Policies, &out.Policies, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineClassPolicies_To_v1alpha3_VirtualMachineClassPolicies(&in.Policies, &out.Policies, s); err != nil { return err } out.Description = in.Description @@ -1235,17 +1224,17 @@ func autoConvert_v1alpha1_VirtualMachineClassSpec_To_v1alpha2_VirtualMachineClas return nil } -// Convert_v1alpha1_VirtualMachineClassSpec_To_v1alpha2_VirtualMachineClassSpec is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineClassSpec_To_v1alpha2_VirtualMachineClassSpec(in *VirtualMachineClassSpec, out *v1alpha2.VirtualMachineClassSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineClassSpec_To_v1alpha2_VirtualMachineClassSpec(in, out, s) +// Convert_v1alpha1_VirtualMachineClassSpec_To_v1alpha3_VirtualMachineClassSpec is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineClassSpec_To_v1alpha3_VirtualMachineClassSpec(in *VirtualMachineClassSpec, out *v1alpha3.VirtualMachineClassSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineClassSpec_To_v1alpha3_VirtualMachineClassSpec(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineClassSpec_To_v1alpha1_VirtualMachineClassSpec(in *v1alpha2.VirtualMachineClassSpec, out *VirtualMachineClassSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineClassSpec_To_v1alpha1_VirtualMachineClassSpec(in *v1alpha3.VirtualMachineClassSpec, out *VirtualMachineClassSpec, s conversion.Scope) error { out.ControllerName = in.ControllerName - if err := Convert_v1alpha2_VirtualMachineClassHardware_To_v1alpha1_VirtualMachineClassHardware(&in.Hardware, &out.Hardware, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineClassHardware_To_v1alpha1_VirtualMachineClassHardware(&in.Hardware, &out.Hardware, s); err != nil { return err } - if err := Convert_v1alpha2_VirtualMachineClassPolicies_To_v1alpha1_VirtualMachineClassPolicies(&in.Policies, &out.Policies, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineClassPolicies_To_v1alpha1_VirtualMachineClassPolicies(&in.Policies, &out.Policies, s); err != nil { return err } out.Description = in.Description @@ -1253,63 +1242,63 @@ func autoConvert_v1alpha2_VirtualMachineClassSpec_To_v1alpha1_VirtualMachineClas return nil } -// Convert_v1alpha2_VirtualMachineClassSpec_To_v1alpha1_VirtualMachineClassSpec is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineClassSpec_To_v1alpha1_VirtualMachineClassSpec(in *v1alpha2.VirtualMachineClassSpec, out *VirtualMachineClassSpec, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineClassSpec_To_v1alpha1_VirtualMachineClassSpec(in, out, s) +// Convert_v1alpha3_VirtualMachineClassSpec_To_v1alpha1_VirtualMachineClassSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineClassSpec_To_v1alpha1_VirtualMachineClassSpec(in *v1alpha3.VirtualMachineClassSpec, out *VirtualMachineClassSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineClassSpec_To_v1alpha1_VirtualMachineClassSpec(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineClassStatus_To_v1alpha2_VirtualMachineClassStatus(in *VirtualMachineClassStatus, out *v1alpha2.VirtualMachineClassStatus, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineClassStatus_To_v1alpha3_VirtualMachineClassStatus(in *VirtualMachineClassStatus, out *v1alpha3.VirtualMachineClassStatus, s conversion.Scope) error { return nil } -// Convert_v1alpha1_VirtualMachineClassStatus_To_v1alpha2_VirtualMachineClassStatus is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineClassStatus_To_v1alpha2_VirtualMachineClassStatus(in *VirtualMachineClassStatus, out *v1alpha2.VirtualMachineClassStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineClassStatus_To_v1alpha2_VirtualMachineClassStatus(in, out, s) +// Convert_v1alpha1_VirtualMachineClassStatus_To_v1alpha3_VirtualMachineClassStatus is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineClassStatus_To_v1alpha3_VirtualMachineClassStatus(in *VirtualMachineClassStatus, out *v1alpha3.VirtualMachineClassStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineClassStatus_To_v1alpha3_VirtualMachineClassStatus(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineClassStatus_To_v1alpha1_VirtualMachineClassStatus(in *v1alpha2.VirtualMachineClassStatus, out *VirtualMachineClassStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineClassStatus_To_v1alpha1_VirtualMachineClassStatus(in *v1alpha3.VirtualMachineClassStatus, out *VirtualMachineClassStatus, s conversion.Scope) error { return nil } -func autoConvert_v1alpha1_VirtualMachineImage_To_v1alpha2_VirtualMachineImage(in *VirtualMachineImage, out *v1alpha2.VirtualMachineImage, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineImage_To_v1alpha3_VirtualMachineImage(in *VirtualMachineImage, out *v1alpha3.VirtualMachineImage, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha1_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineImageStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineImageStatus_To_v1alpha3_VirtualMachineImageStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha1_VirtualMachineImage_To_v1alpha2_VirtualMachineImage is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineImage_To_v1alpha2_VirtualMachineImage(in *VirtualMachineImage, out *v1alpha2.VirtualMachineImage, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineImage_To_v1alpha2_VirtualMachineImage(in, out, s) +// Convert_v1alpha1_VirtualMachineImage_To_v1alpha3_VirtualMachineImage is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineImage_To_v1alpha3_VirtualMachineImage(in *VirtualMachineImage, out *v1alpha3.VirtualMachineImage, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineImage_To_v1alpha3_VirtualMachineImage(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineImage_To_v1alpha1_VirtualMachineImage(in *v1alpha2.VirtualMachineImage, out *VirtualMachineImage, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineImage_To_v1alpha1_VirtualMachineImage(in *v1alpha3.VirtualMachineImage, out *VirtualMachineImage, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_VirtualMachineImageSpec_To_v1alpha1_VirtualMachineImageSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineImageSpec_To_v1alpha1_VirtualMachineImageSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha2_VirtualMachineImage_To_v1alpha1_VirtualMachineImage is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineImage_To_v1alpha1_VirtualMachineImage(in *v1alpha2.VirtualMachineImage, out *VirtualMachineImage, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineImage_To_v1alpha1_VirtualMachineImage(in, out, s) +// Convert_v1alpha3_VirtualMachineImage_To_v1alpha1_VirtualMachineImage is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineImage_To_v1alpha1_VirtualMachineImage(in *v1alpha3.VirtualMachineImage, out *VirtualMachineImage, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineImage_To_v1alpha1_VirtualMachineImage(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineImageList_To_v1alpha2_VirtualMachineImageList(in *VirtualMachineImageList, out *v1alpha2.VirtualMachineImageList, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineImageList_To_v1alpha3_VirtualMachineImageList(in *VirtualMachineImageList, out *v1alpha3.VirtualMachineImageList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha2.VirtualMachineImage, len(*in)) + *out = make([]v1alpha3.VirtualMachineImage, len(*in)) for i := range *in { - if err := Convert_v1alpha1_VirtualMachineImage_To_v1alpha2_VirtualMachineImage(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha1_VirtualMachineImage_To_v1alpha3_VirtualMachineImage(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1319,18 +1308,18 @@ func autoConvert_v1alpha1_VirtualMachineImageList_To_v1alpha2_VirtualMachineImag return nil } -// Convert_v1alpha1_VirtualMachineImageList_To_v1alpha2_VirtualMachineImageList is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineImageList_To_v1alpha2_VirtualMachineImageList(in *VirtualMachineImageList, out *v1alpha2.VirtualMachineImageList, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineImageList_To_v1alpha2_VirtualMachineImageList(in, out, s) +// Convert_v1alpha1_VirtualMachineImageList_To_v1alpha3_VirtualMachineImageList is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineImageList_To_v1alpha3_VirtualMachineImageList(in *VirtualMachineImageList, out *v1alpha3.VirtualMachineImageList, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineImageList_To_v1alpha3_VirtualMachineImageList(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineImageList_To_v1alpha1_VirtualMachineImageList(in *v1alpha2.VirtualMachineImageList, out *VirtualMachineImageList, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineImageList_To_v1alpha1_VirtualMachineImageList(in *v1alpha3.VirtualMachineImageList, out *VirtualMachineImageList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]VirtualMachineImage, len(*in)) for i := range *in { - if err := Convert_v1alpha2_VirtualMachineImage_To_v1alpha1_VirtualMachineImage(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_VirtualMachineImage_To_v1alpha1_VirtualMachineImage(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1340,30 +1329,30 @@ func autoConvert_v1alpha2_VirtualMachineImageList_To_v1alpha1_VirtualMachineImag return nil } -// Convert_v1alpha2_VirtualMachineImageList_To_v1alpha1_VirtualMachineImageList is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineImageList_To_v1alpha1_VirtualMachineImageList(in *v1alpha2.VirtualMachineImageList, out *VirtualMachineImageList, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineImageList_To_v1alpha1_VirtualMachineImageList(in, out, s) +// Convert_v1alpha3_VirtualMachineImageList_To_v1alpha1_VirtualMachineImageList is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineImageList_To_v1alpha1_VirtualMachineImageList(in *v1alpha3.VirtualMachineImageList, out *VirtualMachineImageList, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineImageList_To_v1alpha1_VirtualMachineImageList(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha2_VirtualMachineImageOSInfo(in *VirtualMachineImageOSInfo, out *v1alpha2.VirtualMachineImageOSInfo, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha3_VirtualMachineImageOSInfo(in *VirtualMachineImageOSInfo, out *v1alpha3.VirtualMachineImageOSInfo, s conversion.Scope) error { out.Version = in.Version out.Type = in.Type return nil } -// Convert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha2_VirtualMachineImageOSInfo is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha2_VirtualMachineImageOSInfo(in *VirtualMachineImageOSInfo, out *v1alpha2.VirtualMachineImageOSInfo, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha2_VirtualMachineImageOSInfo(in, out, s) +// Convert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha3_VirtualMachineImageOSInfo is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha3_VirtualMachineImageOSInfo(in *VirtualMachineImageOSInfo, out *v1alpha3.VirtualMachineImageOSInfo, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineImageOSInfo_To_v1alpha3_VirtualMachineImageOSInfo(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineImageOSInfo_To_v1alpha1_VirtualMachineImageOSInfo(in *v1alpha2.VirtualMachineImageOSInfo, out *VirtualMachineImageOSInfo, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineImageOSInfo_To_v1alpha1_VirtualMachineImageOSInfo(in *v1alpha3.VirtualMachineImageOSInfo, out *VirtualMachineImageOSInfo, s conversion.Scope) error { // WARNING: in.ID requires manual conversion: does not exist in peer-type out.Type = in.Type out.Version = in.Version return nil } -func autoConvert_v1alpha1_VirtualMachineImageProductInfo_To_v1alpha2_VirtualMachineImageProductInfo(in *VirtualMachineImageProductInfo, out *v1alpha2.VirtualMachineImageProductInfo, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineImageProductInfo_To_v1alpha3_VirtualMachineImageProductInfo(in *VirtualMachineImageProductInfo, out *v1alpha3.VirtualMachineImageProductInfo, s conversion.Scope) error { out.Product = in.Product out.Vendor = in.Vendor out.Version = in.Version @@ -1371,12 +1360,12 @@ func autoConvert_v1alpha1_VirtualMachineImageProductInfo_To_v1alpha2_VirtualMach return nil } -// Convert_v1alpha1_VirtualMachineImageProductInfo_To_v1alpha2_VirtualMachineImageProductInfo is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineImageProductInfo_To_v1alpha2_VirtualMachineImageProductInfo(in *VirtualMachineImageProductInfo, out *v1alpha2.VirtualMachineImageProductInfo, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineImageProductInfo_To_v1alpha2_VirtualMachineImageProductInfo(in, out, s) +// Convert_v1alpha1_VirtualMachineImageProductInfo_To_v1alpha3_VirtualMachineImageProductInfo is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineImageProductInfo_To_v1alpha3_VirtualMachineImageProductInfo(in *VirtualMachineImageProductInfo, out *v1alpha3.VirtualMachineImageProductInfo, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineImageProductInfo_To_v1alpha3_VirtualMachineImageProductInfo(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineImageProductInfo_To_v1alpha1_VirtualMachineImageProductInfo(in *v1alpha2.VirtualMachineImageProductInfo, out *VirtualMachineImageProductInfo, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineImageProductInfo_To_v1alpha1_VirtualMachineImageProductInfo(in *v1alpha3.VirtualMachineImageProductInfo, out *VirtualMachineImageProductInfo, s conversion.Scope) error { out.Product = in.Product out.Vendor = in.Vendor out.Version = in.Version @@ -1384,18 +1373,16 @@ func autoConvert_v1alpha2_VirtualMachineImageProductInfo_To_v1alpha1_VirtualMach return nil } -// Convert_v1alpha2_VirtualMachineImageProductInfo_To_v1alpha1_VirtualMachineImageProductInfo is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineImageProductInfo_To_v1alpha1_VirtualMachineImageProductInfo(in *v1alpha2.VirtualMachineImageProductInfo, out *VirtualMachineImageProductInfo, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineImageProductInfo_To_v1alpha1_VirtualMachineImageProductInfo(in, out, s) +// Convert_v1alpha3_VirtualMachineImageProductInfo_To_v1alpha1_VirtualMachineImageProductInfo is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineImageProductInfo_To_v1alpha1_VirtualMachineImageProductInfo(in *v1alpha3.VirtualMachineImageProductInfo, out *VirtualMachineImageProductInfo, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineImageProductInfo_To_v1alpha1_VirtualMachineImageProductInfo(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSpec(in *VirtualMachineImageSpec, out *v1alpha2.VirtualMachineImageSpec, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageSpec(in *VirtualMachineImageSpec, out *v1alpha3.VirtualMachineImageSpec, s conversion.Scope) error { // WARNING: in.Type requires manual conversion: does not exist in peer-type // WARNING: in.ImageSourceType requires manual conversion: does not exist in peer-type // WARNING: in.ImageID requires manual conversion: does not exist in peer-type - if err := Convert_v1alpha1_ContentProviderReference_To_common_LocalObjectRef(&in.ProviderRef, &out.ProviderRef, s); err != nil { - return err - } + // WARNING: in.ProviderRef requires manual conversion: inconvertible types (github.com/vmware-tanzu/vm-operator/api/v1alpha1.ContentProviderReference vs *github.com/vmware-tanzu/vm-operator/api/v1alpha3/common.LocalObjectRef) // WARNING: in.ProductInfo requires manual conversion: does not exist in peer-type // WARNING: in.OSInfo requires manual conversion: does not exist in peer-type // WARNING: in.OVFEnv requires manual conversion: does not exist in peer-type @@ -1403,19 +1390,12 @@ func autoConvert_v1alpha1_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImag return nil } -func autoConvert_v1alpha2_VirtualMachineImageSpec_To_v1alpha1_VirtualMachineImageSpec(in *v1alpha2.VirtualMachineImageSpec, out *VirtualMachineImageSpec, s conversion.Scope) error { - if err := Convert_common_LocalObjectRef_To_v1alpha1_ContentProviderReference(&in.ProviderRef, &out.ProviderRef, s); err != nil { - return err - } +func autoConvert_v1alpha3_VirtualMachineImageSpec_To_v1alpha1_VirtualMachineImageSpec(in *v1alpha3.VirtualMachineImageSpec, out *VirtualMachineImageSpec, s conversion.Scope) error { + // WARNING: in.ProviderRef requires manual conversion: inconvertible types (*github.com/vmware-tanzu/vm-operator/api/v1alpha3/common.LocalObjectRef vs github.com/vmware-tanzu/vm-operator/api/v1alpha1.ContentProviderReference) return nil } -// Convert_v1alpha2_VirtualMachineImageSpec_To_v1alpha1_VirtualMachineImageSpec is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineImageSpec_To_v1alpha1_VirtualMachineImageSpec(in *v1alpha2.VirtualMachineImageSpec, out *VirtualMachineImageSpec, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineImageSpec_To_v1alpha1_VirtualMachineImageSpec(in, out, s) -} - -func autoConvert_v1alpha1_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineImageStatus(in *VirtualMachineImageStatus, out *v1alpha2.VirtualMachineImageStatus, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineImageStatus_To_v1alpha3_VirtualMachineImageStatus(in *VirtualMachineImageStatus, out *v1alpha3.VirtualMachineImageStatus, s conversion.Scope) error { // WARNING: in.Uuid requires manual conversion: does not exist in peer-type // WARNING: in.InternalId requires manual conversion: does not exist in peer-type // WARNING: in.PowerState requires manual conversion: does not exist in peer-type @@ -1438,7 +1418,7 @@ func autoConvert_v1alpha1_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineIm return nil } -func autoConvert_v1alpha2_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageStatus(in *v1alpha2.VirtualMachineImageStatus, out *VirtualMachineImageStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineImageStatus(in *v1alpha3.VirtualMachineImageStatus, out *VirtualMachineImageStatus, s conversion.Scope) error { // WARNING: in.Name requires manual conversion: does not exist in peer-type // WARNING: in.Capabilities requires manual conversion: does not exist in peer-type out.Firmware = in.Firmware @@ -1463,13 +1443,13 @@ func autoConvert_v1alpha2_VirtualMachineImageStatus_To_v1alpha1_VirtualMachineIm return nil } -func autoConvert_v1alpha1_VirtualMachineList_To_v1alpha2_VirtualMachineList(in *VirtualMachineList, out *v1alpha2.VirtualMachineList, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineList_To_v1alpha3_VirtualMachineList(in *VirtualMachineList, out *v1alpha3.VirtualMachineList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha2.VirtualMachine, len(*in)) + *out = make([]v1alpha3.VirtualMachine, len(*in)) for i := range *in { - if err := Convert_v1alpha1_VirtualMachine_To_v1alpha2_VirtualMachine(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha1_VirtualMachine_To_v1alpha3_VirtualMachine(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1479,18 +1459,18 @@ func autoConvert_v1alpha1_VirtualMachineList_To_v1alpha2_VirtualMachineList(in * return nil } -// Convert_v1alpha1_VirtualMachineList_To_v1alpha2_VirtualMachineList is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineList_To_v1alpha2_VirtualMachineList(in *VirtualMachineList, out *v1alpha2.VirtualMachineList, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineList_To_v1alpha2_VirtualMachineList(in, out, s) +// Convert_v1alpha1_VirtualMachineList_To_v1alpha3_VirtualMachineList is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineList_To_v1alpha3_VirtualMachineList(in *VirtualMachineList, out *v1alpha3.VirtualMachineList, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineList_To_v1alpha3_VirtualMachineList(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineList_To_v1alpha1_VirtualMachineList(in *v1alpha2.VirtualMachineList, out *VirtualMachineList, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineList_To_v1alpha1_VirtualMachineList(in *v1alpha3.VirtualMachineList, out *VirtualMachineList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]VirtualMachine, len(*in)) for i := range *in { - if err := Convert_v1alpha2_VirtualMachine_To_v1alpha1_VirtualMachine(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_VirtualMachine_To_v1alpha1_VirtualMachine(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1500,50 +1480,50 @@ func autoConvert_v1alpha2_VirtualMachineList_To_v1alpha1_VirtualMachineList(in * return nil } -// Convert_v1alpha2_VirtualMachineList_To_v1alpha1_VirtualMachineList is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineList_To_v1alpha1_VirtualMachineList(in *v1alpha2.VirtualMachineList, out *VirtualMachineList, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineList_To_v1alpha1_VirtualMachineList(in, out, s) +// Convert_v1alpha3_VirtualMachineList_To_v1alpha1_VirtualMachineList is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineList_To_v1alpha1_VirtualMachineList(in *v1alpha3.VirtualMachineList, out *VirtualMachineList, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineList_To_v1alpha1_VirtualMachineList(in, out, s) } -func autoConvert_v1alpha1_VirtualMachinePublishRequest_To_v1alpha2_VirtualMachinePublishRequest(in *VirtualMachinePublishRequest, out *v1alpha2.VirtualMachinePublishRequest, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachinePublishRequest_To_v1alpha3_VirtualMachinePublishRequest(in *VirtualMachinePublishRequest, out *v1alpha3.VirtualMachinePublishRequest, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_VirtualMachinePublishRequestSpec_To_v1alpha2_VirtualMachinePublishRequestSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha1_VirtualMachinePublishRequestSpec_To_v1alpha3_VirtualMachinePublishRequestSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha1_VirtualMachinePublishRequestStatus_To_v1alpha2_VirtualMachinePublishRequestStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha1_VirtualMachinePublishRequestStatus_To_v1alpha3_VirtualMachinePublishRequestStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha1_VirtualMachinePublishRequest_To_v1alpha2_VirtualMachinePublishRequest is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachinePublishRequest_To_v1alpha2_VirtualMachinePublishRequest(in *VirtualMachinePublishRequest, out *v1alpha2.VirtualMachinePublishRequest, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachinePublishRequest_To_v1alpha2_VirtualMachinePublishRequest(in, out, s) +// Convert_v1alpha1_VirtualMachinePublishRequest_To_v1alpha3_VirtualMachinePublishRequest is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachinePublishRequest_To_v1alpha3_VirtualMachinePublishRequest(in *VirtualMachinePublishRequest, out *v1alpha3.VirtualMachinePublishRequest, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachinePublishRequest_To_v1alpha3_VirtualMachinePublishRequest(in, out, s) } -func autoConvert_v1alpha2_VirtualMachinePublishRequest_To_v1alpha1_VirtualMachinePublishRequest(in *v1alpha2.VirtualMachinePublishRequest, out *VirtualMachinePublishRequest, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachinePublishRequest_To_v1alpha1_VirtualMachinePublishRequest(in *v1alpha3.VirtualMachinePublishRequest, out *VirtualMachinePublishRequest, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_VirtualMachinePublishRequestSpec_To_v1alpha1_VirtualMachinePublishRequestSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_VirtualMachinePublishRequestSpec_To_v1alpha1_VirtualMachinePublishRequestSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha2_VirtualMachinePublishRequestStatus_To_v1alpha1_VirtualMachinePublishRequestStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_VirtualMachinePublishRequestStatus_To_v1alpha1_VirtualMachinePublishRequestStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha2_VirtualMachinePublishRequest_To_v1alpha1_VirtualMachinePublishRequest is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachinePublishRequest_To_v1alpha1_VirtualMachinePublishRequest(in *v1alpha2.VirtualMachinePublishRequest, out *VirtualMachinePublishRequest, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachinePublishRequest_To_v1alpha1_VirtualMachinePublishRequest(in, out, s) +// Convert_v1alpha3_VirtualMachinePublishRequest_To_v1alpha1_VirtualMachinePublishRequest is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequest_To_v1alpha1_VirtualMachinePublishRequest(in *v1alpha3.VirtualMachinePublishRequest, out *VirtualMachinePublishRequest, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequest_To_v1alpha1_VirtualMachinePublishRequest(in, out, s) } -func autoConvert_v1alpha1_VirtualMachinePublishRequestList_To_v1alpha2_VirtualMachinePublishRequestList(in *VirtualMachinePublishRequestList, out *v1alpha2.VirtualMachinePublishRequestList, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachinePublishRequestList_To_v1alpha3_VirtualMachinePublishRequestList(in *VirtualMachinePublishRequestList, out *v1alpha3.VirtualMachinePublishRequestList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha2.VirtualMachinePublishRequest, len(*in)) + *out = make([]v1alpha3.VirtualMachinePublishRequest, len(*in)) for i := range *in { - if err := Convert_v1alpha1_VirtualMachinePublishRequest_To_v1alpha2_VirtualMachinePublishRequest(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha1_VirtualMachinePublishRequest_To_v1alpha3_VirtualMachinePublishRequest(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1553,18 +1533,18 @@ func autoConvert_v1alpha1_VirtualMachinePublishRequestList_To_v1alpha2_VirtualMa return nil } -// Convert_v1alpha1_VirtualMachinePublishRequestList_To_v1alpha2_VirtualMachinePublishRequestList is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachinePublishRequestList_To_v1alpha2_VirtualMachinePublishRequestList(in *VirtualMachinePublishRequestList, out *v1alpha2.VirtualMachinePublishRequestList, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachinePublishRequestList_To_v1alpha2_VirtualMachinePublishRequestList(in, out, s) +// Convert_v1alpha1_VirtualMachinePublishRequestList_To_v1alpha3_VirtualMachinePublishRequestList is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachinePublishRequestList_To_v1alpha3_VirtualMachinePublishRequestList(in *VirtualMachinePublishRequestList, out *v1alpha3.VirtualMachinePublishRequestList, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachinePublishRequestList_To_v1alpha3_VirtualMachinePublishRequestList(in, out, s) } -func autoConvert_v1alpha2_VirtualMachinePublishRequestList_To_v1alpha1_VirtualMachinePublishRequestList(in *v1alpha2.VirtualMachinePublishRequestList, out *VirtualMachinePublishRequestList, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachinePublishRequestList_To_v1alpha1_VirtualMachinePublishRequestList(in *v1alpha3.VirtualMachinePublishRequestList, out *VirtualMachinePublishRequestList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]VirtualMachinePublishRequest, len(*in)) for i := range *in { - if err := Convert_v1alpha2_VirtualMachinePublishRequest_To_v1alpha1_VirtualMachinePublishRequest(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_VirtualMachinePublishRequest_To_v1alpha1_VirtualMachinePublishRequest(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1574,70 +1554,70 @@ func autoConvert_v1alpha2_VirtualMachinePublishRequestList_To_v1alpha1_VirtualMa return nil } -// Convert_v1alpha2_VirtualMachinePublishRequestList_To_v1alpha1_VirtualMachinePublishRequestList is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachinePublishRequestList_To_v1alpha1_VirtualMachinePublishRequestList(in *v1alpha2.VirtualMachinePublishRequestList, out *VirtualMachinePublishRequestList, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachinePublishRequestList_To_v1alpha1_VirtualMachinePublishRequestList(in, out, s) +// Convert_v1alpha3_VirtualMachinePublishRequestList_To_v1alpha1_VirtualMachinePublishRequestList is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequestList_To_v1alpha1_VirtualMachinePublishRequestList(in *v1alpha3.VirtualMachinePublishRequestList, out *VirtualMachinePublishRequestList, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequestList_To_v1alpha1_VirtualMachinePublishRequestList(in, out, s) } -func autoConvert_v1alpha1_VirtualMachinePublishRequestSource_To_v1alpha2_VirtualMachinePublishRequestSource(in *VirtualMachinePublishRequestSource, out *v1alpha2.VirtualMachinePublishRequestSource, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachinePublishRequestSource_To_v1alpha3_VirtualMachinePublishRequestSource(in *VirtualMachinePublishRequestSource, out *v1alpha3.VirtualMachinePublishRequestSource, s conversion.Scope) error { out.Name = in.Name out.APIVersion = in.APIVersion out.Kind = in.Kind return nil } -// Convert_v1alpha1_VirtualMachinePublishRequestSource_To_v1alpha2_VirtualMachinePublishRequestSource is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachinePublishRequestSource_To_v1alpha2_VirtualMachinePublishRequestSource(in *VirtualMachinePublishRequestSource, out *v1alpha2.VirtualMachinePublishRequestSource, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachinePublishRequestSource_To_v1alpha2_VirtualMachinePublishRequestSource(in, out, s) +// Convert_v1alpha1_VirtualMachinePublishRequestSource_To_v1alpha3_VirtualMachinePublishRequestSource is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachinePublishRequestSource_To_v1alpha3_VirtualMachinePublishRequestSource(in *VirtualMachinePublishRequestSource, out *v1alpha3.VirtualMachinePublishRequestSource, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachinePublishRequestSource_To_v1alpha3_VirtualMachinePublishRequestSource(in, out, s) } -func autoConvert_v1alpha2_VirtualMachinePublishRequestSource_To_v1alpha1_VirtualMachinePublishRequestSource(in *v1alpha2.VirtualMachinePublishRequestSource, out *VirtualMachinePublishRequestSource, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachinePublishRequestSource_To_v1alpha1_VirtualMachinePublishRequestSource(in *v1alpha3.VirtualMachinePublishRequestSource, out *VirtualMachinePublishRequestSource, s conversion.Scope) error { out.Name = in.Name out.APIVersion = in.APIVersion out.Kind = in.Kind return nil } -// Convert_v1alpha2_VirtualMachinePublishRequestSource_To_v1alpha1_VirtualMachinePublishRequestSource is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachinePublishRequestSource_To_v1alpha1_VirtualMachinePublishRequestSource(in *v1alpha2.VirtualMachinePublishRequestSource, out *VirtualMachinePublishRequestSource, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachinePublishRequestSource_To_v1alpha1_VirtualMachinePublishRequestSource(in, out, s) +// Convert_v1alpha3_VirtualMachinePublishRequestSource_To_v1alpha1_VirtualMachinePublishRequestSource is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequestSource_To_v1alpha1_VirtualMachinePublishRequestSource(in *v1alpha3.VirtualMachinePublishRequestSource, out *VirtualMachinePublishRequestSource, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequestSource_To_v1alpha1_VirtualMachinePublishRequestSource(in, out, s) } -func autoConvert_v1alpha1_VirtualMachinePublishRequestSpec_To_v1alpha2_VirtualMachinePublishRequestSpec(in *VirtualMachinePublishRequestSpec, out *v1alpha2.VirtualMachinePublishRequestSpec, s conversion.Scope) error { - if err := Convert_v1alpha1_VirtualMachinePublishRequestSource_To_v1alpha2_VirtualMachinePublishRequestSource(&in.Source, &out.Source, s); err != nil { +func autoConvert_v1alpha1_VirtualMachinePublishRequestSpec_To_v1alpha3_VirtualMachinePublishRequestSpec(in *VirtualMachinePublishRequestSpec, out *v1alpha3.VirtualMachinePublishRequestSpec, s conversion.Scope) error { + if err := Convert_v1alpha1_VirtualMachinePublishRequestSource_To_v1alpha3_VirtualMachinePublishRequestSource(&in.Source, &out.Source, s); err != nil { return err } - if err := Convert_v1alpha1_VirtualMachinePublishRequestTarget_To_v1alpha2_VirtualMachinePublishRequestTarget(&in.Target, &out.Target, s); err != nil { + if err := Convert_v1alpha1_VirtualMachinePublishRequestTarget_To_v1alpha3_VirtualMachinePublishRequestTarget(&in.Target, &out.Target, s); err != nil { return err } out.TTLSecondsAfterFinished = (*int64)(unsafe.Pointer(in.TTLSecondsAfterFinished)) return nil } -// Convert_v1alpha1_VirtualMachinePublishRequestSpec_To_v1alpha2_VirtualMachinePublishRequestSpec is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachinePublishRequestSpec_To_v1alpha2_VirtualMachinePublishRequestSpec(in *VirtualMachinePublishRequestSpec, out *v1alpha2.VirtualMachinePublishRequestSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachinePublishRequestSpec_To_v1alpha2_VirtualMachinePublishRequestSpec(in, out, s) +// Convert_v1alpha1_VirtualMachinePublishRequestSpec_To_v1alpha3_VirtualMachinePublishRequestSpec is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachinePublishRequestSpec_To_v1alpha3_VirtualMachinePublishRequestSpec(in *VirtualMachinePublishRequestSpec, out *v1alpha3.VirtualMachinePublishRequestSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachinePublishRequestSpec_To_v1alpha3_VirtualMachinePublishRequestSpec(in, out, s) } -func autoConvert_v1alpha2_VirtualMachinePublishRequestSpec_To_v1alpha1_VirtualMachinePublishRequestSpec(in *v1alpha2.VirtualMachinePublishRequestSpec, out *VirtualMachinePublishRequestSpec, s conversion.Scope) error { - if err := Convert_v1alpha2_VirtualMachinePublishRequestSource_To_v1alpha1_VirtualMachinePublishRequestSource(&in.Source, &out.Source, s); err != nil { +func autoConvert_v1alpha3_VirtualMachinePublishRequestSpec_To_v1alpha1_VirtualMachinePublishRequestSpec(in *v1alpha3.VirtualMachinePublishRequestSpec, out *VirtualMachinePublishRequestSpec, s conversion.Scope) error { + if err := Convert_v1alpha3_VirtualMachinePublishRequestSource_To_v1alpha1_VirtualMachinePublishRequestSource(&in.Source, &out.Source, s); err != nil { return err } - if err := Convert_v1alpha2_VirtualMachinePublishRequestTarget_To_v1alpha1_VirtualMachinePublishRequestTarget(&in.Target, &out.Target, s); err != nil { + if err := Convert_v1alpha3_VirtualMachinePublishRequestTarget_To_v1alpha1_VirtualMachinePublishRequestTarget(&in.Target, &out.Target, s); err != nil { return err } out.TTLSecondsAfterFinished = (*int64)(unsafe.Pointer(in.TTLSecondsAfterFinished)) return nil } -// Convert_v1alpha2_VirtualMachinePublishRequestSpec_To_v1alpha1_VirtualMachinePublishRequestSpec is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachinePublishRequestSpec_To_v1alpha1_VirtualMachinePublishRequestSpec(in *v1alpha2.VirtualMachinePublishRequestSpec, out *VirtualMachinePublishRequestSpec, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachinePublishRequestSpec_To_v1alpha1_VirtualMachinePublishRequestSpec(in, out, s) +// Convert_v1alpha3_VirtualMachinePublishRequestSpec_To_v1alpha1_VirtualMachinePublishRequestSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequestSpec_To_v1alpha1_VirtualMachinePublishRequestSpec(in *v1alpha3.VirtualMachinePublishRequestSpec, out *VirtualMachinePublishRequestSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequestSpec_To_v1alpha1_VirtualMachinePublishRequestSpec(in, out, s) } -func autoConvert_v1alpha1_VirtualMachinePublishRequestStatus_To_v1alpha2_VirtualMachinePublishRequestStatus(in *VirtualMachinePublishRequestStatus, out *v1alpha2.VirtualMachinePublishRequestStatus, s conversion.Scope) error { - out.SourceRef = (*v1alpha2.VirtualMachinePublishRequestSource)(unsafe.Pointer(in.SourceRef)) - out.TargetRef = (*v1alpha2.VirtualMachinePublishRequestTarget)(unsafe.Pointer(in.TargetRef)) +func autoConvert_v1alpha1_VirtualMachinePublishRequestStatus_To_v1alpha3_VirtualMachinePublishRequestStatus(in *VirtualMachinePublishRequestStatus, out *v1alpha3.VirtualMachinePublishRequestStatus, s conversion.Scope) error { + out.SourceRef = (*v1alpha3.VirtualMachinePublishRequestSource)(unsafe.Pointer(in.SourceRef)) + out.TargetRef = (*v1alpha3.VirtualMachinePublishRequestTarget)(unsafe.Pointer(in.TargetRef)) out.CompletionTime = in.CompletionTime out.StartTime = in.StartTime out.Attempts = in.Attempts @@ -1658,12 +1638,12 @@ func autoConvert_v1alpha1_VirtualMachinePublishRequestStatus_To_v1alpha2_Virtual return nil } -// Convert_v1alpha1_VirtualMachinePublishRequestStatus_To_v1alpha2_VirtualMachinePublishRequestStatus is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachinePublishRequestStatus_To_v1alpha2_VirtualMachinePublishRequestStatus(in *VirtualMachinePublishRequestStatus, out *v1alpha2.VirtualMachinePublishRequestStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachinePublishRequestStatus_To_v1alpha2_VirtualMachinePublishRequestStatus(in, out, s) +// Convert_v1alpha1_VirtualMachinePublishRequestStatus_To_v1alpha3_VirtualMachinePublishRequestStatus is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachinePublishRequestStatus_To_v1alpha3_VirtualMachinePublishRequestStatus(in *VirtualMachinePublishRequestStatus, out *v1alpha3.VirtualMachinePublishRequestStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachinePublishRequestStatus_To_v1alpha3_VirtualMachinePublishRequestStatus(in, out, s) } -func autoConvert_v1alpha2_VirtualMachinePublishRequestStatus_To_v1alpha1_VirtualMachinePublishRequestStatus(in *v1alpha2.VirtualMachinePublishRequestStatus, out *VirtualMachinePublishRequestStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachinePublishRequestStatus_To_v1alpha1_VirtualMachinePublishRequestStatus(in *v1alpha3.VirtualMachinePublishRequestStatus, out *VirtualMachinePublishRequestStatus, s conversion.Scope) error { out.SourceRef = (*VirtualMachinePublishRequestSource)(unsafe.Pointer(in.SourceRef)) out.TargetRef = (*VirtualMachinePublishRequestTarget)(unsafe.Pointer(in.TargetRef)) out.CompletionTime = in.CompletionTime @@ -1686,164 +1666,164 @@ func autoConvert_v1alpha2_VirtualMachinePublishRequestStatus_To_v1alpha1_Virtual return nil } -// Convert_v1alpha2_VirtualMachinePublishRequestStatus_To_v1alpha1_VirtualMachinePublishRequestStatus is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachinePublishRequestStatus_To_v1alpha1_VirtualMachinePublishRequestStatus(in *v1alpha2.VirtualMachinePublishRequestStatus, out *VirtualMachinePublishRequestStatus, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachinePublishRequestStatus_To_v1alpha1_VirtualMachinePublishRequestStatus(in, out, s) +// Convert_v1alpha3_VirtualMachinePublishRequestStatus_To_v1alpha1_VirtualMachinePublishRequestStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequestStatus_To_v1alpha1_VirtualMachinePublishRequestStatus(in *v1alpha3.VirtualMachinePublishRequestStatus, out *VirtualMachinePublishRequestStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequestStatus_To_v1alpha1_VirtualMachinePublishRequestStatus(in, out, s) } -func autoConvert_v1alpha1_VirtualMachinePublishRequestTarget_To_v1alpha2_VirtualMachinePublishRequestTarget(in *VirtualMachinePublishRequestTarget, out *v1alpha2.VirtualMachinePublishRequestTarget, s conversion.Scope) error { - if err := Convert_v1alpha1_VirtualMachinePublishRequestTargetItem_To_v1alpha2_VirtualMachinePublishRequestTargetItem(&in.Item, &out.Item, s); err != nil { +func autoConvert_v1alpha1_VirtualMachinePublishRequestTarget_To_v1alpha3_VirtualMachinePublishRequestTarget(in *VirtualMachinePublishRequestTarget, out *v1alpha3.VirtualMachinePublishRequestTarget, s conversion.Scope) error { + if err := Convert_v1alpha1_VirtualMachinePublishRequestTargetItem_To_v1alpha3_VirtualMachinePublishRequestTargetItem(&in.Item, &out.Item, s); err != nil { return err } - if err := Convert_v1alpha1_VirtualMachinePublishRequestTargetLocation_To_v1alpha2_VirtualMachinePublishRequestTargetLocation(&in.Location, &out.Location, s); err != nil { + if err := Convert_v1alpha1_VirtualMachinePublishRequestTargetLocation_To_v1alpha3_VirtualMachinePublishRequestTargetLocation(&in.Location, &out.Location, s); err != nil { return err } return nil } -// Convert_v1alpha1_VirtualMachinePublishRequestTarget_To_v1alpha2_VirtualMachinePublishRequestTarget is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachinePublishRequestTarget_To_v1alpha2_VirtualMachinePublishRequestTarget(in *VirtualMachinePublishRequestTarget, out *v1alpha2.VirtualMachinePublishRequestTarget, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachinePublishRequestTarget_To_v1alpha2_VirtualMachinePublishRequestTarget(in, out, s) +// Convert_v1alpha1_VirtualMachinePublishRequestTarget_To_v1alpha3_VirtualMachinePublishRequestTarget is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachinePublishRequestTarget_To_v1alpha3_VirtualMachinePublishRequestTarget(in *VirtualMachinePublishRequestTarget, out *v1alpha3.VirtualMachinePublishRequestTarget, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachinePublishRequestTarget_To_v1alpha3_VirtualMachinePublishRequestTarget(in, out, s) } -func autoConvert_v1alpha2_VirtualMachinePublishRequestTarget_To_v1alpha1_VirtualMachinePublishRequestTarget(in *v1alpha2.VirtualMachinePublishRequestTarget, out *VirtualMachinePublishRequestTarget, s conversion.Scope) error { - if err := Convert_v1alpha2_VirtualMachinePublishRequestTargetItem_To_v1alpha1_VirtualMachinePublishRequestTargetItem(&in.Item, &out.Item, s); err != nil { +func autoConvert_v1alpha3_VirtualMachinePublishRequestTarget_To_v1alpha1_VirtualMachinePublishRequestTarget(in *v1alpha3.VirtualMachinePublishRequestTarget, out *VirtualMachinePublishRequestTarget, s conversion.Scope) error { + if err := Convert_v1alpha3_VirtualMachinePublishRequestTargetItem_To_v1alpha1_VirtualMachinePublishRequestTargetItem(&in.Item, &out.Item, s); err != nil { return err } - if err := Convert_v1alpha2_VirtualMachinePublishRequestTargetLocation_To_v1alpha1_VirtualMachinePublishRequestTargetLocation(&in.Location, &out.Location, s); err != nil { + if err := Convert_v1alpha3_VirtualMachinePublishRequestTargetLocation_To_v1alpha1_VirtualMachinePublishRequestTargetLocation(&in.Location, &out.Location, s); err != nil { return err } return nil } -// Convert_v1alpha2_VirtualMachinePublishRequestTarget_To_v1alpha1_VirtualMachinePublishRequestTarget is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachinePublishRequestTarget_To_v1alpha1_VirtualMachinePublishRequestTarget(in *v1alpha2.VirtualMachinePublishRequestTarget, out *VirtualMachinePublishRequestTarget, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachinePublishRequestTarget_To_v1alpha1_VirtualMachinePublishRequestTarget(in, out, s) +// Convert_v1alpha3_VirtualMachinePublishRequestTarget_To_v1alpha1_VirtualMachinePublishRequestTarget is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequestTarget_To_v1alpha1_VirtualMachinePublishRequestTarget(in *v1alpha3.VirtualMachinePublishRequestTarget, out *VirtualMachinePublishRequestTarget, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequestTarget_To_v1alpha1_VirtualMachinePublishRequestTarget(in, out, s) } -func autoConvert_v1alpha1_VirtualMachinePublishRequestTargetItem_To_v1alpha2_VirtualMachinePublishRequestTargetItem(in *VirtualMachinePublishRequestTargetItem, out *v1alpha2.VirtualMachinePublishRequestTargetItem, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachinePublishRequestTargetItem_To_v1alpha3_VirtualMachinePublishRequestTargetItem(in *VirtualMachinePublishRequestTargetItem, out *v1alpha3.VirtualMachinePublishRequestTargetItem, s conversion.Scope) error { out.Name = in.Name out.Description = in.Description return nil } -// Convert_v1alpha1_VirtualMachinePublishRequestTargetItem_To_v1alpha2_VirtualMachinePublishRequestTargetItem is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachinePublishRequestTargetItem_To_v1alpha2_VirtualMachinePublishRequestTargetItem(in *VirtualMachinePublishRequestTargetItem, out *v1alpha2.VirtualMachinePublishRequestTargetItem, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachinePublishRequestTargetItem_To_v1alpha2_VirtualMachinePublishRequestTargetItem(in, out, s) +// Convert_v1alpha1_VirtualMachinePublishRequestTargetItem_To_v1alpha3_VirtualMachinePublishRequestTargetItem is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachinePublishRequestTargetItem_To_v1alpha3_VirtualMachinePublishRequestTargetItem(in *VirtualMachinePublishRequestTargetItem, out *v1alpha3.VirtualMachinePublishRequestTargetItem, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachinePublishRequestTargetItem_To_v1alpha3_VirtualMachinePublishRequestTargetItem(in, out, s) } -func autoConvert_v1alpha2_VirtualMachinePublishRequestTargetItem_To_v1alpha1_VirtualMachinePublishRequestTargetItem(in *v1alpha2.VirtualMachinePublishRequestTargetItem, out *VirtualMachinePublishRequestTargetItem, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachinePublishRequestTargetItem_To_v1alpha1_VirtualMachinePublishRequestTargetItem(in *v1alpha3.VirtualMachinePublishRequestTargetItem, out *VirtualMachinePublishRequestTargetItem, s conversion.Scope) error { out.Name = in.Name out.Description = in.Description return nil } -// Convert_v1alpha2_VirtualMachinePublishRequestTargetItem_To_v1alpha1_VirtualMachinePublishRequestTargetItem is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachinePublishRequestTargetItem_To_v1alpha1_VirtualMachinePublishRequestTargetItem(in *v1alpha2.VirtualMachinePublishRequestTargetItem, out *VirtualMachinePublishRequestTargetItem, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachinePublishRequestTargetItem_To_v1alpha1_VirtualMachinePublishRequestTargetItem(in, out, s) +// Convert_v1alpha3_VirtualMachinePublishRequestTargetItem_To_v1alpha1_VirtualMachinePublishRequestTargetItem is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequestTargetItem_To_v1alpha1_VirtualMachinePublishRequestTargetItem(in *v1alpha3.VirtualMachinePublishRequestTargetItem, out *VirtualMachinePublishRequestTargetItem, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequestTargetItem_To_v1alpha1_VirtualMachinePublishRequestTargetItem(in, out, s) } -func autoConvert_v1alpha1_VirtualMachinePublishRequestTargetLocation_To_v1alpha2_VirtualMachinePublishRequestTargetLocation(in *VirtualMachinePublishRequestTargetLocation, out *v1alpha2.VirtualMachinePublishRequestTargetLocation, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachinePublishRequestTargetLocation_To_v1alpha3_VirtualMachinePublishRequestTargetLocation(in *VirtualMachinePublishRequestTargetLocation, out *v1alpha3.VirtualMachinePublishRequestTargetLocation, s conversion.Scope) error { out.Name = in.Name out.APIVersion = in.APIVersion out.Kind = in.Kind return nil } -// Convert_v1alpha1_VirtualMachinePublishRequestTargetLocation_To_v1alpha2_VirtualMachinePublishRequestTargetLocation is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachinePublishRequestTargetLocation_To_v1alpha2_VirtualMachinePublishRequestTargetLocation(in *VirtualMachinePublishRequestTargetLocation, out *v1alpha2.VirtualMachinePublishRequestTargetLocation, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachinePublishRequestTargetLocation_To_v1alpha2_VirtualMachinePublishRequestTargetLocation(in, out, s) +// Convert_v1alpha1_VirtualMachinePublishRequestTargetLocation_To_v1alpha3_VirtualMachinePublishRequestTargetLocation is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachinePublishRequestTargetLocation_To_v1alpha3_VirtualMachinePublishRequestTargetLocation(in *VirtualMachinePublishRequestTargetLocation, out *v1alpha3.VirtualMachinePublishRequestTargetLocation, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachinePublishRequestTargetLocation_To_v1alpha3_VirtualMachinePublishRequestTargetLocation(in, out, s) } -func autoConvert_v1alpha2_VirtualMachinePublishRequestTargetLocation_To_v1alpha1_VirtualMachinePublishRequestTargetLocation(in *v1alpha2.VirtualMachinePublishRequestTargetLocation, out *VirtualMachinePublishRequestTargetLocation, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachinePublishRequestTargetLocation_To_v1alpha1_VirtualMachinePublishRequestTargetLocation(in *v1alpha3.VirtualMachinePublishRequestTargetLocation, out *VirtualMachinePublishRequestTargetLocation, s conversion.Scope) error { out.Name = in.Name out.APIVersion = in.APIVersion out.Kind = in.Kind return nil } -// Convert_v1alpha2_VirtualMachinePublishRequestTargetLocation_To_v1alpha1_VirtualMachinePublishRequestTargetLocation is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachinePublishRequestTargetLocation_To_v1alpha1_VirtualMachinePublishRequestTargetLocation(in *v1alpha2.VirtualMachinePublishRequestTargetLocation, out *VirtualMachinePublishRequestTargetLocation, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachinePublishRequestTargetLocation_To_v1alpha1_VirtualMachinePublishRequestTargetLocation(in, out, s) +// Convert_v1alpha3_VirtualMachinePublishRequestTargetLocation_To_v1alpha1_VirtualMachinePublishRequestTargetLocation is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequestTargetLocation_To_v1alpha1_VirtualMachinePublishRequestTargetLocation(in *v1alpha3.VirtualMachinePublishRequestTargetLocation, out *VirtualMachinePublishRequestTargetLocation, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequestTargetLocation_To_v1alpha1_VirtualMachinePublishRequestTargetLocation(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(in *VirtualMachineResourceSpec, out *v1alpha2.VirtualMachineResourceSpec, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(in *VirtualMachineResourceSpec, out *v1alpha3.VirtualMachineResourceSpec, s conversion.Scope) error { out.Cpu = in.Cpu out.Memory = in.Memory return nil } -// Convert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(in *VirtualMachineResourceSpec, out *v1alpha2.VirtualMachineResourceSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(in, out, s) +// Convert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(in *VirtualMachineResourceSpec, out *v1alpha3.VirtualMachineResourceSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(in *v1alpha2.VirtualMachineResourceSpec, out *VirtualMachineResourceSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(in *v1alpha3.VirtualMachineResourceSpec, out *VirtualMachineResourceSpec, s conversion.Scope) error { out.Cpu = in.Cpu out.Memory = in.Memory return nil } -// Convert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(in *v1alpha2.VirtualMachineResourceSpec, out *VirtualMachineResourceSpec, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(in, out, s) +// Convert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(in *v1alpha3.VirtualMachineResourceSpec, out *VirtualMachineResourceSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha1_VirtualMachineResourceSpec(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineService_To_v1alpha2_VirtualMachineService(in *VirtualMachineService, out *v1alpha2.VirtualMachineService, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineService_To_v1alpha3_VirtualMachineService(in *VirtualMachineService, out *v1alpha3.VirtualMachineService, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_VirtualMachineServiceSpec_To_v1alpha2_VirtualMachineServiceSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineServiceSpec_To_v1alpha3_VirtualMachineServiceSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha1_VirtualMachineServiceStatus_To_v1alpha2_VirtualMachineServiceStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineServiceStatus_To_v1alpha3_VirtualMachineServiceStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha1_VirtualMachineService_To_v1alpha2_VirtualMachineService is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineService_To_v1alpha2_VirtualMachineService(in *VirtualMachineService, out *v1alpha2.VirtualMachineService, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineService_To_v1alpha2_VirtualMachineService(in, out, s) +// Convert_v1alpha1_VirtualMachineService_To_v1alpha3_VirtualMachineService is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineService_To_v1alpha3_VirtualMachineService(in *VirtualMachineService, out *v1alpha3.VirtualMachineService, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineService_To_v1alpha3_VirtualMachineService(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineService_To_v1alpha1_VirtualMachineService(in *v1alpha2.VirtualMachineService, out *VirtualMachineService, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineService_To_v1alpha1_VirtualMachineService(in *v1alpha3.VirtualMachineService, out *VirtualMachineService, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_VirtualMachineServiceSpec_To_v1alpha1_VirtualMachineServiceSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineServiceSpec_To_v1alpha1_VirtualMachineServiceSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha2_VirtualMachineServiceStatus_To_v1alpha1_VirtualMachineServiceStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineServiceStatus_To_v1alpha1_VirtualMachineServiceStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha2_VirtualMachineService_To_v1alpha1_VirtualMachineService is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineService_To_v1alpha1_VirtualMachineService(in *v1alpha2.VirtualMachineService, out *VirtualMachineService, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineService_To_v1alpha1_VirtualMachineService(in, out, s) +// Convert_v1alpha3_VirtualMachineService_To_v1alpha1_VirtualMachineService is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineService_To_v1alpha1_VirtualMachineService(in *v1alpha3.VirtualMachineService, out *VirtualMachineService, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineService_To_v1alpha1_VirtualMachineService(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineServiceList_To_v1alpha2_VirtualMachineServiceList(in *VirtualMachineServiceList, out *v1alpha2.VirtualMachineServiceList, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineServiceList_To_v1alpha3_VirtualMachineServiceList(in *VirtualMachineServiceList, out *v1alpha3.VirtualMachineServiceList, s conversion.Scope) error { out.ListMeta = in.ListMeta - out.Items = *(*[]v1alpha2.VirtualMachineService)(unsafe.Pointer(&in.Items)) + out.Items = *(*[]v1alpha3.VirtualMachineService)(unsafe.Pointer(&in.Items)) return nil } -// Convert_v1alpha1_VirtualMachineServiceList_To_v1alpha2_VirtualMachineServiceList is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineServiceList_To_v1alpha2_VirtualMachineServiceList(in *VirtualMachineServiceList, out *v1alpha2.VirtualMachineServiceList, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineServiceList_To_v1alpha2_VirtualMachineServiceList(in, out, s) +// Convert_v1alpha1_VirtualMachineServiceList_To_v1alpha3_VirtualMachineServiceList is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineServiceList_To_v1alpha3_VirtualMachineServiceList(in *VirtualMachineServiceList, out *v1alpha3.VirtualMachineServiceList, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineServiceList_To_v1alpha3_VirtualMachineServiceList(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineServiceList_To_v1alpha1_VirtualMachineServiceList(in *v1alpha2.VirtualMachineServiceList, out *VirtualMachineServiceList, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineServiceList_To_v1alpha1_VirtualMachineServiceList(in *v1alpha3.VirtualMachineServiceList, out *VirtualMachineServiceList, s conversion.Scope) error { out.ListMeta = in.ListMeta out.Items = *(*[]VirtualMachineService)(unsafe.Pointer(&in.Items)) return nil } -// Convert_v1alpha2_VirtualMachineServiceList_To_v1alpha1_VirtualMachineServiceList is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineServiceList_To_v1alpha1_VirtualMachineServiceList(in *v1alpha2.VirtualMachineServiceList, out *VirtualMachineServiceList, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineServiceList_To_v1alpha1_VirtualMachineServiceList(in, out, s) +// Convert_v1alpha3_VirtualMachineServiceList_To_v1alpha1_VirtualMachineServiceList is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineServiceList_To_v1alpha1_VirtualMachineServiceList(in *v1alpha3.VirtualMachineServiceList, out *VirtualMachineServiceList, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineServiceList_To_v1alpha1_VirtualMachineServiceList(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineServicePort_To_v1alpha2_VirtualMachineServicePort(in *VirtualMachineServicePort, out *v1alpha2.VirtualMachineServicePort, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineServicePort_To_v1alpha3_VirtualMachineServicePort(in *VirtualMachineServicePort, out *v1alpha3.VirtualMachineServicePort, s conversion.Scope) error { out.Name = in.Name out.Protocol = in.Protocol out.Port = in.Port @@ -1851,12 +1831,12 @@ func autoConvert_v1alpha1_VirtualMachineServicePort_To_v1alpha2_VirtualMachineSe return nil } -// Convert_v1alpha1_VirtualMachineServicePort_To_v1alpha2_VirtualMachineServicePort is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineServicePort_To_v1alpha2_VirtualMachineServicePort(in *VirtualMachineServicePort, out *v1alpha2.VirtualMachineServicePort, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineServicePort_To_v1alpha2_VirtualMachineServicePort(in, out, s) +// Convert_v1alpha1_VirtualMachineServicePort_To_v1alpha3_VirtualMachineServicePort is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineServicePort_To_v1alpha3_VirtualMachineServicePort(in *VirtualMachineServicePort, out *v1alpha3.VirtualMachineServicePort, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineServicePort_To_v1alpha3_VirtualMachineServicePort(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineServicePort_To_v1alpha1_VirtualMachineServicePort(in *v1alpha2.VirtualMachineServicePort, out *VirtualMachineServicePort, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineServicePort_To_v1alpha1_VirtualMachineServicePort(in *v1alpha3.VirtualMachineServicePort, out *VirtualMachineServicePort, s conversion.Scope) error { out.Name = in.Name out.Protocol = in.Protocol out.Port = in.Port @@ -1864,14 +1844,14 @@ func autoConvert_v1alpha2_VirtualMachineServicePort_To_v1alpha1_VirtualMachineSe return nil } -// Convert_v1alpha2_VirtualMachineServicePort_To_v1alpha1_VirtualMachineServicePort is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineServicePort_To_v1alpha1_VirtualMachineServicePort(in *v1alpha2.VirtualMachineServicePort, out *VirtualMachineServicePort, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineServicePort_To_v1alpha1_VirtualMachineServicePort(in, out, s) +// Convert_v1alpha3_VirtualMachineServicePort_To_v1alpha1_VirtualMachineServicePort is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineServicePort_To_v1alpha1_VirtualMachineServicePort(in *v1alpha3.VirtualMachineServicePort, out *VirtualMachineServicePort, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineServicePort_To_v1alpha1_VirtualMachineServicePort(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineServiceSpec_To_v1alpha2_VirtualMachineServiceSpec(in *VirtualMachineServiceSpec, out *v1alpha2.VirtualMachineServiceSpec, s conversion.Scope) error { - out.Type = v1alpha2.VirtualMachineServiceType(in.Type) - out.Ports = *(*[]v1alpha2.VirtualMachineServicePort)(unsafe.Pointer(&in.Ports)) +func autoConvert_v1alpha1_VirtualMachineServiceSpec_To_v1alpha3_VirtualMachineServiceSpec(in *VirtualMachineServiceSpec, out *v1alpha3.VirtualMachineServiceSpec, s conversion.Scope) error { + out.Type = v1alpha3.VirtualMachineServiceType(in.Type) + out.Ports = *(*[]v1alpha3.VirtualMachineServicePort)(unsafe.Pointer(&in.Ports)) out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) out.LoadBalancerIP = in.LoadBalancerIP out.LoadBalancerSourceRanges = *(*[]string)(unsafe.Pointer(&in.LoadBalancerSourceRanges)) @@ -1880,12 +1860,12 @@ func autoConvert_v1alpha1_VirtualMachineServiceSpec_To_v1alpha2_VirtualMachineSe return nil } -// Convert_v1alpha1_VirtualMachineServiceSpec_To_v1alpha2_VirtualMachineServiceSpec is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineServiceSpec_To_v1alpha2_VirtualMachineServiceSpec(in *VirtualMachineServiceSpec, out *v1alpha2.VirtualMachineServiceSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineServiceSpec_To_v1alpha2_VirtualMachineServiceSpec(in, out, s) +// Convert_v1alpha1_VirtualMachineServiceSpec_To_v1alpha3_VirtualMachineServiceSpec is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineServiceSpec_To_v1alpha3_VirtualMachineServiceSpec(in *VirtualMachineServiceSpec, out *v1alpha3.VirtualMachineServiceSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineServiceSpec_To_v1alpha3_VirtualMachineServiceSpec(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineServiceSpec_To_v1alpha1_VirtualMachineServiceSpec(in *v1alpha2.VirtualMachineServiceSpec, out *VirtualMachineServiceSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineServiceSpec_To_v1alpha1_VirtualMachineServiceSpec(in *v1alpha3.VirtualMachineServiceSpec, out *VirtualMachineServiceSpec, s conversion.Scope) error { out.Type = VirtualMachineServiceType(in.Type) out.Ports = *(*[]VirtualMachineServicePort)(unsafe.Pointer(&in.Ports)) out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) @@ -1896,74 +1876,74 @@ func autoConvert_v1alpha2_VirtualMachineServiceSpec_To_v1alpha1_VirtualMachineSe return nil } -// Convert_v1alpha2_VirtualMachineServiceSpec_To_v1alpha1_VirtualMachineServiceSpec is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineServiceSpec_To_v1alpha1_VirtualMachineServiceSpec(in *v1alpha2.VirtualMachineServiceSpec, out *VirtualMachineServiceSpec, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineServiceSpec_To_v1alpha1_VirtualMachineServiceSpec(in, out, s) +// Convert_v1alpha3_VirtualMachineServiceSpec_To_v1alpha1_VirtualMachineServiceSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineServiceSpec_To_v1alpha1_VirtualMachineServiceSpec(in *v1alpha3.VirtualMachineServiceSpec, out *VirtualMachineServiceSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineServiceSpec_To_v1alpha1_VirtualMachineServiceSpec(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineServiceStatus_To_v1alpha2_VirtualMachineServiceStatus(in *VirtualMachineServiceStatus, out *v1alpha2.VirtualMachineServiceStatus, s conversion.Scope) error { - if err := Convert_v1alpha1_LoadBalancerStatus_To_v1alpha2_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, s); err != nil { +func autoConvert_v1alpha1_VirtualMachineServiceStatus_To_v1alpha3_VirtualMachineServiceStatus(in *VirtualMachineServiceStatus, out *v1alpha3.VirtualMachineServiceStatus, s conversion.Scope) error { + if err := Convert_v1alpha1_LoadBalancerStatus_To_v1alpha3_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, s); err != nil { return err } return nil } -// Convert_v1alpha1_VirtualMachineServiceStatus_To_v1alpha2_VirtualMachineServiceStatus is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineServiceStatus_To_v1alpha2_VirtualMachineServiceStatus(in *VirtualMachineServiceStatus, out *v1alpha2.VirtualMachineServiceStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineServiceStatus_To_v1alpha2_VirtualMachineServiceStatus(in, out, s) +// Convert_v1alpha1_VirtualMachineServiceStatus_To_v1alpha3_VirtualMachineServiceStatus is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineServiceStatus_To_v1alpha3_VirtualMachineServiceStatus(in *VirtualMachineServiceStatus, out *v1alpha3.VirtualMachineServiceStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineServiceStatus_To_v1alpha3_VirtualMachineServiceStatus(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineServiceStatus_To_v1alpha1_VirtualMachineServiceStatus(in *v1alpha2.VirtualMachineServiceStatus, out *VirtualMachineServiceStatus, s conversion.Scope) error { - if err := Convert_v1alpha2_LoadBalancerStatus_To_v1alpha1_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, s); err != nil { +func autoConvert_v1alpha3_VirtualMachineServiceStatus_To_v1alpha1_VirtualMachineServiceStatus(in *v1alpha3.VirtualMachineServiceStatus, out *VirtualMachineServiceStatus, s conversion.Scope) error { + if err := Convert_v1alpha3_LoadBalancerStatus_To_v1alpha1_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, s); err != nil { return err } return nil } -// Convert_v1alpha2_VirtualMachineServiceStatus_To_v1alpha1_VirtualMachineServiceStatus is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineServiceStatus_To_v1alpha1_VirtualMachineServiceStatus(in *v1alpha2.VirtualMachineServiceStatus, out *VirtualMachineServiceStatus, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineServiceStatus_To_v1alpha1_VirtualMachineServiceStatus(in, out, s) +// Convert_v1alpha3_VirtualMachineServiceStatus_To_v1alpha1_VirtualMachineServiceStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineServiceStatus_To_v1alpha1_VirtualMachineServiceStatus(in *v1alpha3.VirtualMachineServiceStatus, out *VirtualMachineServiceStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineServiceStatus_To_v1alpha1_VirtualMachineServiceStatus(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineSetResourcePolicy_To_v1alpha2_VirtualMachineSetResourcePolicy(in *VirtualMachineSetResourcePolicy, out *v1alpha2.VirtualMachineSetResourcePolicy, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineSetResourcePolicy_To_v1alpha3_VirtualMachineSetResourcePolicy(in *VirtualMachineSetResourcePolicy, out *v1alpha3.VirtualMachineSetResourcePolicy, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_VirtualMachineSetResourcePolicySpec_To_v1alpha2_VirtualMachineSetResourcePolicySpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineSetResourcePolicySpec_To_v1alpha3_VirtualMachineSetResourcePolicySpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha1_VirtualMachineSetResourcePolicyStatus_To_v1alpha2_VirtualMachineSetResourcePolicyStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha1_VirtualMachineSetResourcePolicyStatus_To_v1alpha3_VirtualMachineSetResourcePolicyStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha1_VirtualMachineSetResourcePolicy_To_v1alpha2_VirtualMachineSetResourcePolicy is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineSetResourcePolicy_To_v1alpha2_VirtualMachineSetResourcePolicy(in *VirtualMachineSetResourcePolicy, out *v1alpha2.VirtualMachineSetResourcePolicy, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineSetResourcePolicy_To_v1alpha2_VirtualMachineSetResourcePolicy(in, out, s) +// Convert_v1alpha1_VirtualMachineSetResourcePolicy_To_v1alpha3_VirtualMachineSetResourcePolicy is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineSetResourcePolicy_To_v1alpha3_VirtualMachineSetResourcePolicy(in *VirtualMachineSetResourcePolicy, out *v1alpha3.VirtualMachineSetResourcePolicy, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineSetResourcePolicy_To_v1alpha3_VirtualMachineSetResourcePolicy(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineSetResourcePolicy_To_v1alpha1_VirtualMachineSetResourcePolicy(in *v1alpha2.VirtualMachineSetResourcePolicy, out *VirtualMachineSetResourcePolicy, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineSetResourcePolicy_To_v1alpha1_VirtualMachineSetResourcePolicy(in *v1alpha3.VirtualMachineSetResourcePolicy, out *VirtualMachineSetResourcePolicy, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_VirtualMachineSetResourcePolicySpec_To_v1alpha1_VirtualMachineSetResourcePolicySpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineSetResourcePolicySpec_To_v1alpha1_VirtualMachineSetResourcePolicySpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha2_VirtualMachineSetResourcePolicyStatus_To_v1alpha1_VirtualMachineSetResourcePolicyStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineSetResourcePolicyStatus_To_v1alpha1_VirtualMachineSetResourcePolicyStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha2_VirtualMachineSetResourcePolicy_To_v1alpha1_VirtualMachineSetResourcePolicy is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineSetResourcePolicy_To_v1alpha1_VirtualMachineSetResourcePolicy(in *v1alpha2.VirtualMachineSetResourcePolicy, out *VirtualMachineSetResourcePolicy, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineSetResourcePolicy_To_v1alpha1_VirtualMachineSetResourcePolicy(in, out, s) +// Convert_v1alpha3_VirtualMachineSetResourcePolicy_To_v1alpha1_VirtualMachineSetResourcePolicy is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineSetResourcePolicy_To_v1alpha1_VirtualMachineSetResourcePolicy(in *v1alpha3.VirtualMachineSetResourcePolicy, out *VirtualMachineSetResourcePolicy, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineSetResourcePolicy_To_v1alpha1_VirtualMachineSetResourcePolicy(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineSetResourcePolicyList_To_v1alpha2_VirtualMachineSetResourcePolicyList(in *VirtualMachineSetResourcePolicyList, out *v1alpha2.VirtualMachineSetResourcePolicyList, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineSetResourcePolicyList_To_v1alpha3_VirtualMachineSetResourcePolicyList(in *VirtualMachineSetResourcePolicyList, out *v1alpha3.VirtualMachineSetResourcePolicyList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha2.VirtualMachineSetResourcePolicy, len(*in)) + *out = make([]v1alpha3.VirtualMachineSetResourcePolicy, len(*in)) for i := range *in { - if err := Convert_v1alpha1_VirtualMachineSetResourcePolicy_To_v1alpha2_VirtualMachineSetResourcePolicy(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha1_VirtualMachineSetResourcePolicy_To_v1alpha3_VirtualMachineSetResourcePolicy(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1973,18 +1953,18 @@ func autoConvert_v1alpha1_VirtualMachineSetResourcePolicyList_To_v1alpha2_Virtua return nil } -// Convert_v1alpha1_VirtualMachineSetResourcePolicyList_To_v1alpha2_VirtualMachineSetResourcePolicyList is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineSetResourcePolicyList_To_v1alpha2_VirtualMachineSetResourcePolicyList(in *VirtualMachineSetResourcePolicyList, out *v1alpha2.VirtualMachineSetResourcePolicyList, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineSetResourcePolicyList_To_v1alpha2_VirtualMachineSetResourcePolicyList(in, out, s) +// Convert_v1alpha1_VirtualMachineSetResourcePolicyList_To_v1alpha3_VirtualMachineSetResourcePolicyList is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineSetResourcePolicyList_To_v1alpha3_VirtualMachineSetResourcePolicyList(in *VirtualMachineSetResourcePolicyList, out *v1alpha3.VirtualMachineSetResourcePolicyList, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineSetResourcePolicyList_To_v1alpha3_VirtualMachineSetResourcePolicyList(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineSetResourcePolicyList_To_v1alpha1_VirtualMachineSetResourcePolicyList(in *v1alpha2.VirtualMachineSetResourcePolicyList, out *VirtualMachineSetResourcePolicyList, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineSetResourcePolicyList_To_v1alpha1_VirtualMachineSetResourcePolicyList(in *v1alpha3.VirtualMachineSetResourcePolicyList, out *VirtualMachineSetResourcePolicyList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]VirtualMachineSetResourcePolicy, len(*in)) for i := range *in { - if err := Convert_v1alpha2_VirtualMachineSetResourcePolicy_To_v1alpha1_VirtualMachineSetResourcePolicy(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_VirtualMachineSetResourcePolicy_To_v1alpha1_VirtualMachineSetResourcePolicy(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1994,13 +1974,13 @@ func autoConvert_v1alpha2_VirtualMachineSetResourcePolicyList_To_v1alpha1_Virtua return nil } -// Convert_v1alpha2_VirtualMachineSetResourcePolicyList_To_v1alpha1_VirtualMachineSetResourcePolicyList is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineSetResourcePolicyList_To_v1alpha1_VirtualMachineSetResourcePolicyList(in *v1alpha2.VirtualMachineSetResourcePolicyList, out *VirtualMachineSetResourcePolicyList, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineSetResourcePolicyList_To_v1alpha1_VirtualMachineSetResourcePolicyList(in, out, s) +// Convert_v1alpha3_VirtualMachineSetResourcePolicyList_To_v1alpha1_VirtualMachineSetResourcePolicyList is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineSetResourcePolicyList_To_v1alpha1_VirtualMachineSetResourcePolicyList(in *v1alpha3.VirtualMachineSetResourcePolicyList, out *VirtualMachineSetResourcePolicyList, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineSetResourcePolicyList_To_v1alpha1_VirtualMachineSetResourcePolicyList(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineSetResourcePolicySpec_To_v1alpha2_VirtualMachineSetResourcePolicySpec(in *VirtualMachineSetResourcePolicySpec, out *v1alpha2.VirtualMachineSetResourcePolicySpec, s conversion.Scope) error { - if err := Convert_v1alpha1_ResourcePoolSpec_To_v1alpha2_ResourcePoolSpec(&in.ResourcePool, &out.ResourcePool, s); err != nil { +func autoConvert_v1alpha1_VirtualMachineSetResourcePolicySpec_To_v1alpha3_VirtualMachineSetResourcePolicySpec(in *VirtualMachineSetResourcePolicySpec, out *v1alpha3.VirtualMachineSetResourcePolicySpec, s conversion.Scope) error { + if err := Convert_v1alpha1_ResourcePoolSpec_To_v1alpha3_ResourcePoolSpec(&in.ResourcePool, &out.ResourcePool, s); err != nil { return err } // WARNING: in.Folder requires manual conversion: inconvertible types (github.com/vmware-tanzu/vm-operator/api/v1alpha1.FolderSpec vs string) @@ -2008,8 +1988,8 @@ func autoConvert_v1alpha1_VirtualMachineSetResourcePolicySpec_To_v1alpha2_Virtua return nil } -func autoConvert_v1alpha2_VirtualMachineSetResourcePolicySpec_To_v1alpha1_VirtualMachineSetResourcePolicySpec(in *v1alpha2.VirtualMachineSetResourcePolicySpec, out *VirtualMachineSetResourcePolicySpec, s conversion.Scope) error { - if err := Convert_v1alpha2_ResourcePoolSpec_To_v1alpha1_ResourcePoolSpec(&in.ResourcePool, &out.ResourcePool, s); err != nil { +func autoConvert_v1alpha3_VirtualMachineSetResourcePolicySpec_To_v1alpha1_VirtualMachineSetResourcePolicySpec(in *v1alpha3.VirtualMachineSetResourcePolicySpec, out *VirtualMachineSetResourcePolicySpec, s conversion.Scope) error { + if err := Convert_v1alpha3_ResourcePoolSpec_To_v1alpha1_ResourcePoolSpec(&in.ResourcePool, &out.ResourcePool, s); err != nil { return err } // WARNING: in.Folder requires manual conversion: inconvertible types (string vs github.com/vmware-tanzu/vm-operator/api/v1alpha1.FolderSpec) @@ -2017,34 +1997,34 @@ func autoConvert_v1alpha2_VirtualMachineSetResourcePolicySpec_To_v1alpha1_Virtua return nil } -func autoConvert_v1alpha1_VirtualMachineSetResourcePolicyStatus_To_v1alpha2_VirtualMachineSetResourcePolicyStatus(in *VirtualMachineSetResourcePolicyStatus, out *v1alpha2.VirtualMachineSetResourcePolicyStatus, s conversion.Scope) error { - out.ClusterModules = *(*[]v1alpha2.VSphereClusterModuleStatus)(unsafe.Pointer(&in.ClusterModules)) +func autoConvert_v1alpha1_VirtualMachineSetResourcePolicyStatus_To_v1alpha3_VirtualMachineSetResourcePolicyStatus(in *VirtualMachineSetResourcePolicyStatus, out *v1alpha3.VirtualMachineSetResourcePolicyStatus, s conversion.Scope) error { + out.ClusterModules = *(*[]v1alpha3.VSphereClusterModuleStatus)(unsafe.Pointer(&in.ClusterModules)) return nil } -// Convert_v1alpha1_VirtualMachineSetResourcePolicyStatus_To_v1alpha2_VirtualMachineSetResourcePolicyStatus is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineSetResourcePolicyStatus_To_v1alpha2_VirtualMachineSetResourcePolicyStatus(in *VirtualMachineSetResourcePolicyStatus, out *v1alpha2.VirtualMachineSetResourcePolicyStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineSetResourcePolicyStatus_To_v1alpha2_VirtualMachineSetResourcePolicyStatus(in, out, s) +// Convert_v1alpha1_VirtualMachineSetResourcePolicyStatus_To_v1alpha3_VirtualMachineSetResourcePolicyStatus is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineSetResourcePolicyStatus_To_v1alpha3_VirtualMachineSetResourcePolicyStatus(in *VirtualMachineSetResourcePolicyStatus, out *v1alpha3.VirtualMachineSetResourcePolicyStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineSetResourcePolicyStatus_To_v1alpha3_VirtualMachineSetResourcePolicyStatus(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineSetResourcePolicyStatus_To_v1alpha1_VirtualMachineSetResourcePolicyStatus(in *v1alpha2.VirtualMachineSetResourcePolicyStatus, out *VirtualMachineSetResourcePolicyStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineSetResourcePolicyStatus_To_v1alpha1_VirtualMachineSetResourcePolicyStatus(in *v1alpha3.VirtualMachineSetResourcePolicyStatus, out *VirtualMachineSetResourcePolicyStatus, s conversion.Scope) error { out.ClusterModules = *(*[]ClusterModuleStatus)(unsafe.Pointer(&in.ClusterModules)) return nil } -// Convert_v1alpha2_VirtualMachineSetResourcePolicyStatus_To_v1alpha1_VirtualMachineSetResourcePolicyStatus is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineSetResourcePolicyStatus_To_v1alpha1_VirtualMachineSetResourcePolicyStatus(in *v1alpha2.VirtualMachineSetResourcePolicyStatus, out *VirtualMachineSetResourcePolicyStatus, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineSetResourcePolicyStatus_To_v1alpha1_VirtualMachineSetResourcePolicyStatus(in, out, s) +// Convert_v1alpha3_VirtualMachineSetResourcePolicyStatus_To_v1alpha1_VirtualMachineSetResourcePolicyStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineSetResourcePolicyStatus_To_v1alpha1_VirtualMachineSetResourcePolicyStatus(in *v1alpha3.VirtualMachineSetResourcePolicyStatus, out *VirtualMachineSetResourcePolicyStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineSetResourcePolicyStatus_To_v1alpha1_VirtualMachineSetResourcePolicyStatus(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec(in *VirtualMachineSpec, out *v1alpha2.VirtualMachineSpec, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineSpec_To_v1alpha3_VirtualMachineSpec(in *VirtualMachineSpec, out *v1alpha3.VirtualMachineSpec, s conversion.Scope) error { out.ImageName = in.ImageName out.ClassName = in.ClassName - out.PowerState = v1alpha2.VirtualMachinePowerState(in.PowerState) - out.PowerOffMode = v1alpha2.VirtualMachinePowerOpMode(in.PowerOffMode) - out.SuspendMode = v1alpha2.VirtualMachinePowerOpMode(in.SuspendMode) + out.PowerState = v1alpha3.VirtualMachinePowerState(in.PowerState) + out.PowerOffMode = v1alpha3.VirtualMachinePowerOpMode(in.PowerOffMode) + out.SuspendMode = v1alpha3.VirtualMachinePowerOpMode(in.SuspendMode) out.NextRestartTime = in.NextRestartTime - out.RestartMode = v1alpha2.VirtualMachinePowerOpMode(in.RestartMode) + out.RestartMode = v1alpha3.VirtualMachinePowerOpMode(in.RestartMode) // WARNING: in.Ports requires manual conversion: does not exist in peer-type // WARNING: in.VmMetadata requires manual conversion: does not exist in peer-type out.StorageClass = in.StorageClass @@ -2052,9 +2032,9 @@ func autoConvert_v1alpha1_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec(in * // WARNING: in.ResourcePolicyName requires manual conversion: does not exist in peer-type if in.Volumes != nil { in, out := &in.Volumes, &out.Volumes - *out = make([]v1alpha2.VirtualMachineVolume, len(*in)) + *out = make([]v1alpha3.VirtualMachineVolume, len(*in)) for i := range *in { - if err := Convert_v1alpha1_VirtualMachineVolume_To_v1alpha2_VirtualMachineVolume(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha1_VirtualMachineVolume_To_v1alpha3_VirtualMachineVolume(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -2063,8 +2043,8 @@ func autoConvert_v1alpha1_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec(in * } if in.ReadinessProbe != nil { in, out := &in.ReadinessProbe, &out.ReadinessProbe - *out = new(v1alpha2.VirtualMachineReadinessProbeSpec) - if err := Convert_v1alpha1_Probe_To_v1alpha2_VirtualMachineReadinessProbeSpec(*in, *out, s); err != nil { + *out = new(v1alpha3.VirtualMachineReadinessProbeSpec) + if err := Convert_v1alpha1_Probe_To_v1alpha3_VirtualMachineReadinessProbeSpec(*in, *out, s); err != nil { return err } } else { @@ -2075,7 +2055,7 @@ func autoConvert_v1alpha1_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec(in * return nil } -func autoConvert_v1alpha2_VirtualMachineSpec_To_v1alpha1_VirtualMachineSpec(in *v1alpha2.VirtualMachineSpec, out *VirtualMachineSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineSpec_To_v1alpha1_VirtualMachineSpec(in *v1alpha3.VirtualMachineSpec, out *VirtualMachineSpec, s conversion.Scope) error { out.ImageName = in.ImageName out.ClassName = in.ClassName out.StorageClass = in.StorageClass @@ -2090,7 +2070,7 @@ func autoConvert_v1alpha2_VirtualMachineSpec_To_v1alpha1_VirtualMachineSpec(in * in, out := &in.Volumes, &out.Volumes *out = make([]VirtualMachineVolume, len(*in)) for i := range *in { - if err := Convert_v1alpha2_VirtualMachineVolume_To_v1alpha1_VirtualMachineVolume(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_VirtualMachineVolume_To_v1alpha1_VirtualMachineVolume(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -2100,7 +2080,7 @@ func autoConvert_v1alpha2_VirtualMachineSpec_To_v1alpha1_VirtualMachineSpec(in * if in.ReadinessProbe != nil { in, out := &in.ReadinessProbe, &out.ReadinessProbe *out = new(Probe) - if err := Convert_v1alpha2_VirtualMachineReadinessProbeSpec_To_v1alpha1_Probe(*in, *out, s); err != nil { + if err := Convert_v1alpha3_VirtualMachineReadinessProbeSpec_To_v1alpha1_Probe(*in, *out, s); err != nil { return err } } else { @@ -2112,9 +2092,9 @@ func autoConvert_v1alpha2_VirtualMachineSpec_To_v1alpha1_VirtualMachineSpec(in * return nil } -func autoConvert_v1alpha1_VirtualMachineStatus_To_v1alpha2_VirtualMachineStatus(in *VirtualMachineStatus, out *v1alpha2.VirtualMachineStatus, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineStatus_To_v1alpha3_VirtualMachineStatus(in *VirtualMachineStatus, out *v1alpha3.VirtualMachineStatus, s conversion.Scope) error { out.Host = in.Host - out.PowerState = v1alpha2.VirtualMachinePowerState(in.PowerState) + out.PowerState = v1alpha3.VirtualMachinePowerState(in.PowerState) // WARNING: in.Phase requires manual conversion: does not exist in peer-type if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions @@ -2133,9 +2113,9 @@ func autoConvert_v1alpha1_VirtualMachineStatus_To_v1alpha2_VirtualMachineStatus( out.InstanceUUID = in.InstanceUUID if in.Volumes != nil { in, out := &in.Volumes, &out.Volumes - *out = make([]v1alpha2.VirtualMachineVolumeStatus, len(*in)) + *out = make([]v1alpha3.VirtualMachineVolumeStatus, len(*in)) for i := range *in { - if err := Convert_v1alpha1_VirtualMachineVolumeStatus_To_v1alpha2_VirtualMachineVolumeStatus(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha1_VirtualMachineVolumeStatus_To_v1alpha3_VirtualMachineVolumeStatus(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -2150,7 +2130,7 @@ func autoConvert_v1alpha1_VirtualMachineStatus_To_v1alpha2_VirtualMachineStatus( return nil } -func autoConvert_v1alpha2_VirtualMachineStatus_To_v1alpha1_VirtualMachineStatus(in *v1alpha2.VirtualMachineStatus, out *VirtualMachineStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineStatus_To_v1alpha1_VirtualMachineStatus(in *v1alpha3.VirtualMachineStatus, out *VirtualMachineStatus, s conversion.Scope) error { // WARNING: in.Image requires manual conversion: does not exist in peer-type // WARNING: in.Class requires manual conversion: does not exist in peer-type out.Host = in.Host @@ -2174,7 +2154,7 @@ func autoConvert_v1alpha2_VirtualMachineStatus_To_v1alpha1_VirtualMachineStatus( in, out := &in.Volumes, &out.Volumes *out = make([]VirtualMachineVolumeStatus, len(*in)) for i := range *in { - if err := Convert_v1alpha2_VirtualMachineVolumeStatus_To_v1alpha1_VirtualMachineVolumeStatus(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_VirtualMachineVolumeStatus_To_v1alpha1_VirtualMachineVolumeStatus(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -2188,14 +2168,14 @@ func autoConvert_v1alpha2_VirtualMachineStatus_To_v1alpha1_VirtualMachineStatus( return nil } -func autoConvert_v1alpha1_VirtualMachineTemplate_To_v1alpha2_VirtualMachineTemplate(in *VirtualMachineTemplate, out *v1alpha2.VirtualMachineTemplate, s conversion.Scope) error { - if err := Convert_v1alpha1_NetworkStatus_To_v1alpha2_NetworkStatus(&in.Net, &out.Net, s); err != nil { +func autoConvert_v1alpha1_VirtualMachineTemplate_To_v1alpha3_VirtualMachineTemplate(in *VirtualMachineTemplate, out *v1alpha3.VirtualMachineTemplate, s conversion.Scope) error { + if err := Convert_v1alpha1_NetworkStatus_To_v1alpha3_NetworkStatus(&in.Net, &out.Net, s); err != nil { return err } if in.VM != nil { in, out := &in.VM, &out.VM - *out = new(v1alpha2.VirtualMachine) - if err := Convert_v1alpha1_VirtualMachine_To_v1alpha2_VirtualMachine(*in, *out, s); err != nil { + *out = new(v1alpha3.VirtualMachine) + if err := Convert_v1alpha1_VirtualMachine_To_v1alpha3_VirtualMachine(*in, *out, s); err != nil { return err } } else { @@ -2204,19 +2184,19 @@ func autoConvert_v1alpha1_VirtualMachineTemplate_To_v1alpha2_VirtualMachineTempl return nil } -// Convert_v1alpha1_VirtualMachineTemplate_To_v1alpha2_VirtualMachineTemplate is an autogenerated conversion function. -func Convert_v1alpha1_VirtualMachineTemplate_To_v1alpha2_VirtualMachineTemplate(in *VirtualMachineTemplate, out *v1alpha2.VirtualMachineTemplate, s conversion.Scope) error { - return autoConvert_v1alpha1_VirtualMachineTemplate_To_v1alpha2_VirtualMachineTemplate(in, out, s) +// Convert_v1alpha1_VirtualMachineTemplate_To_v1alpha3_VirtualMachineTemplate is an autogenerated conversion function. +func Convert_v1alpha1_VirtualMachineTemplate_To_v1alpha3_VirtualMachineTemplate(in *VirtualMachineTemplate, out *v1alpha3.VirtualMachineTemplate, s conversion.Scope) error { + return autoConvert_v1alpha1_VirtualMachineTemplate_To_v1alpha3_VirtualMachineTemplate(in, out, s) } -func autoConvert_v1alpha2_VirtualMachineTemplate_To_v1alpha1_VirtualMachineTemplate(in *v1alpha2.VirtualMachineTemplate, out *VirtualMachineTemplate, s conversion.Scope) error { - if err := Convert_v1alpha2_NetworkStatus_To_v1alpha1_NetworkStatus(&in.Net, &out.Net, s); err != nil { +func autoConvert_v1alpha3_VirtualMachineTemplate_To_v1alpha1_VirtualMachineTemplate(in *v1alpha3.VirtualMachineTemplate, out *VirtualMachineTemplate, s conversion.Scope) error { + if err := Convert_v1alpha3_NetworkStatus_To_v1alpha1_NetworkStatus(&in.Net, &out.Net, s); err != nil { return err } if in.VM != nil { in, out := &in.VM, &out.VM *out = new(VirtualMachine) - if err := Convert_v1alpha2_VirtualMachine_To_v1alpha1_VirtualMachine(*in, *out, s); err != nil { + if err := Convert_v1alpha3_VirtualMachine_To_v1alpha1_VirtualMachine(*in, *out, s); err != nil { return err } } else { @@ -2225,25 +2205,25 @@ func autoConvert_v1alpha2_VirtualMachineTemplate_To_v1alpha1_VirtualMachineTempl return nil } -// Convert_v1alpha2_VirtualMachineTemplate_To_v1alpha1_VirtualMachineTemplate is an autogenerated conversion function. -func Convert_v1alpha2_VirtualMachineTemplate_To_v1alpha1_VirtualMachineTemplate(in *v1alpha2.VirtualMachineTemplate, out *VirtualMachineTemplate, s conversion.Scope) error { - return autoConvert_v1alpha2_VirtualMachineTemplate_To_v1alpha1_VirtualMachineTemplate(in, out, s) +// Convert_v1alpha3_VirtualMachineTemplate_To_v1alpha1_VirtualMachineTemplate is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineTemplate_To_v1alpha1_VirtualMachineTemplate(in *v1alpha3.VirtualMachineTemplate, out *VirtualMachineTemplate, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineTemplate_To_v1alpha1_VirtualMachineTemplate(in, out, s) } -func autoConvert_v1alpha1_VirtualMachineVolume_To_v1alpha2_VirtualMachineVolume(in *VirtualMachineVolume, out *v1alpha2.VirtualMachineVolume, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineVolume_To_v1alpha3_VirtualMachineVolume(in *VirtualMachineVolume, out *v1alpha3.VirtualMachineVolume, s conversion.Scope) error { out.Name = in.Name // WARNING: in.PersistentVolumeClaim requires manual conversion: does not exist in peer-type // WARNING: in.VsphereVolume requires manual conversion: does not exist in peer-type return nil } -func autoConvert_v1alpha2_VirtualMachineVolume_To_v1alpha1_VirtualMachineVolume(in *v1alpha2.VirtualMachineVolume, out *VirtualMachineVolume, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineVolume_To_v1alpha1_VirtualMachineVolume(in *v1alpha3.VirtualMachineVolume, out *VirtualMachineVolume, s conversion.Scope) error { out.Name = in.Name // WARNING: in.VirtualMachineVolumeSource requires manual conversion: does not exist in peer-type return nil } -func autoConvert_v1alpha1_VirtualMachineVolumeStatus_To_v1alpha2_VirtualMachineVolumeStatus(in *VirtualMachineVolumeStatus, out *v1alpha2.VirtualMachineVolumeStatus, s conversion.Scope) error { +func autoConvert_v1alpha1_VirtualMachineVolumeStatus_To_v1alpha3_VirtualMachineVolumeStatus(in *VirtualMachineVolumeStatus, out *v1alpha3.VirtualMachineVolumeStatus, s conversion.Scope) error { out.Name = in.Name out.Attached = in.Attached // WARNING: in.DiskUuid requires manual conversion: does not exist in peer-type @@ -2251,7 +2231,7 @@ func autoConvert_v1alpha1_VirtualMachineVolumeStatus_To_v1alpha2_VirtualMachineV return nil } -func autoConvert_v1alpha2_VirtualMachineVolumeStatus_To_v1alpha1_VirtualMachineVolumeStatus(in *v1alpha2.VirtualMachineVolumeStatus, out *VirtualMachineVolumeStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_VirtualMachineVolumeStatus_To_v1alpha1_VirtualMachineVolumeStatus(in *v1alpha3.VirtualMachineVolumeStatus, out *VirtualMachineVolumeStatus, s conversion.Scope) error { out.Name = in.Name out.Attached = in.Attached // WARNING: in.DiskUUID requires manual conversion: does not exist in peer-type diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index c90e181d1..e69e2f410 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -1,6 +1,6 @@ //go:build !ignore_autogenerated -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // Code generated by controller-gen. DO NOT EDIT. diff --git a/api/v1alpha2/cloudinit/zz_generated.deepcopy.go b/api/v1alpha2/cloudinit/zz_generated.deepcopy.go index 4e533dfc3..dd1153bf2 100644 --- a/api/v1alpha2/cloudinit/zz_generated.deepcopy.go +++ b/api/v1alpha2/cloudinit/zz_generated.deepcopy.go @@ -1,6 +1,6 @@ //go:build !ignore_autogenerated -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // Code generated by controller-gen. DO NOT EDIT. diff --git a/api/v1alpha2/common/types.go b/api/v1alpha2/common/types.go index 394f3d307..be7897030 100644 --- a/api/v1alpha2/common/types.go +++ b/api/v1alpha2/common/types.go @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // +kubebuilder:object:generate=true diff --git a/api/v1alpha2/common/zz_generated.deepcopy.go b/api/v1alpha2/common/zz_generated.deepcopy.go index 336293f5d..7a5ac5fcd 100644 --- a/api/v1alpha2/common/zz_generated.deepcopy.go +++ b/api/v1alpha2/common/zz_generated.deepcopy.go @@ -1,6 +1,6 @@ //go:build !ignore_autogenerated -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // Code generated by controller-gen. DO NOT EDIT. diff --git a/api/v1alpha2/doc.go b/api/v1alpha2/doc.go index fae59a041..80344fc5e 100644 --- a/api/v1alpha2/doc.go +++ b/api/v1alpha2/doc.go @@ -1,7 +1,8 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2023-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // +k8s:openapi-gen=true // +kubebuilder:object:generate=true // +groupName=vmoperator.vmware.com +// +k8s:conversion-gen=github.com/vmware-tanzu/vm-operator/api/v1alpha3 package v1alpha2 diff --git a/api/v1alpha2/groupversion_info.go b/api/v1alpha2/groupversion_info.go index 7ed022b0a..b5ccecc43 100644 --- a/api/v1alpha2/groupversion_info.go +++ b/api/v1alpha2/groupversion_info.go @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2023-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package v1alpha2 @@ -20,4 +20,7 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme + + // localSchemeBuilder is used for type conversions + localSchemeBuilder = SchemeBuilder.SchemeBuilder ) diff --git a/api/v1alpha2/sysprep/zz_generated.deepcopy.go b/api/v1alpha2/sysprep/zz_generated.deepcopy.go index 41e3a4993..45243161a 100644 --- a/api/v1alpha2/sysprep/zz_generated.deepcopy.go +++ b/api/v1alpha2/sysprep/zz_generated.deepcopy.go @@ -1,6 +1,6 @@ //go:build !ignore_autogenerated -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // Code generated by controller-gen. DO NOT EDIT. diff --git a/api/v1alpha2/virtualmachine_conversion.go b/api/v1alpha2/virtualmachine_conversion.go index 35ac5e0fb..a42fac22f 100644 --- a/api/v1alpha2/virtualmachine_conversion.go +++ b/api/v1alpha2/virtualmachine_conversion.go @@ -1,10 +1,56 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package v1alpha2 -// Hub marks VirtualMachine as a conversion hub. -func (*VirtualMachine) Hub() {} +import ( + "sigs.k8s.io/controller-runtime/pkg/conversion" -// Hub marks VirtualMachineList as a conversion hub. -func (*VirtualMachineList) Hub() {} + "github.com/vmware-tanzu/vm-operator/api/utilconversion" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3" +) + +// ConvertTo converts this VirtualMachine to the Hub version. +func (src *VirtualMachine) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.VirtualMachine) + if err := Convert_v1alpha2_VirtualMachine_To_v1alpha3_VirtualMachine(src, dst, nil); err != nil { + return err + } + + // Manually restore data. + restored := &v1alpha3.VirtualMachine{} + if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { + return err + } + + // BEGIN RESTORE + + // END RESTORE + + dst.Status = restored.Status + + return nil +} + +// ConvertFrom converts the hub version to this VirtualMachine. +func (dst *VirtualMachine) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.VirtualMachine) + if err := Convert_v1alpha3_VirtualMachine_To_v1alpha2_VirtualMachine(src, dst, nil); err != nil { + return err + } + + // Preserve Hub data on down-conversion except for metadata + return utilconversion.MarshalData(src, dst) +} + +// ConvertTo converts this VirtualMachineList to the Hub version. +func (src *VirtualMachineList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.VirtualMachineList) + return Convert_v1alpha2_VirtualMachineList_To_v1alpha3_VirtualMachineList(src, dst, nil) +} + +// ConvertFrom converts the hub version to this VirtualMachineList. +func (dst *VirtualMachineList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.VirtualMachineList) + return Convert_v1alpha3_VirtualMachineList_To_v1alpha2_VirtualMachineList(src, dst, nil) +} diff --git a/api/v1alpha2/virtualmachine_network_types.go b/api/v1alpha2/virtualmachine_network_types.go index a22768fc5..4b60ce088 100644 --- a/api/v1alpha2/virtualmachine_network_types.go +++ b/api/v1alpha2/virtualmachine_network_types.go @@ -42,7 +42,7 @@ type VirtualMachineNetworkInterfaceSpec struct { // Namespace's default network. // // +optional - Network common.PartialObjectRef `json:"network,omitempty"` + Network *common.PartialObjectRef `json:"network,omitempty"` // GuestDeviceName is used to rename the device inside the guest when the // bootstrap provider is Cloud-Init. Please note it is up to the user to diff --git a/api/v1alpha2/virtualmachine_types.go b/api/v1alpha2/virtualmachine_types.go index d5c43d3df..7599e4b76 100644 --- a/api/v1alpha2/virtualmachine_types.go +++ b/api/v1alpha2/virtualmachine_types.go @@ -540,7 +540,6 @@ type VirtualMachineStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Namespaced,shortName=vm -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Power-State",type="string",JSONPath=".status.powerState" // +kubebuilder:printcolumn:name="Class",type="string",priority=1,JSONPath=".spec.className" diff --git a/api/v1alpha2/virtualmachineclass_conversion.go b/api/v1alpha2/virtualmachineclass_conversion.go index e588a95ed..f9c92af16 100644 --- a/api/v1alpha2/virtualmachineclass_conversion.go +++ b/api/v1alpha2/virtualmachineclass_conversion.go @@ -1,10 +1,34 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package v1alpha2 -// Hub marks VirtualMachineClass as a conversion hub. -func (*VirtualMachineClass) Hub() {} +import ( + "sigs.k8s.io/controller-runtime/pkg/conversion" -// Hub marks VirtualMachineClassList as a conversion hub. -func (*VirtualMachineClassList) Hub() {} + "github.com/vmware-tanzu/vm-operator/api/v1alpha3" +) + +// ConvertTo converts this VirtualMachineClass to the Hub version. +func (src *VirtualMachineClass) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.VirtualMachineClass) + return Convert_v1alpha2_VirtualMachineClass_To_v1alpha3_VirtualMachineClass(src, dst, nil) +} + +// ConvertFrom converts the hub version to this VirtualMachineClass. +func (dst *VirtualMachineClass) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.VirtualMachineClass) + return Convert_v1alpha3_VirtualMachineClass_To_v1alpha2_VirtualMachineClass(src, dst, nil) +} + +// ConvertTo converts this VirtualMachineClassList to the Hub version. +func (src *VirtualMachineClassList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.VirtualMachineClassList) + return Convert_v1alpha2_VirtualMachineClassList_To_v1alpha3_VirtualMachineClassList(src, dst, nil) +} + +// ConvertFrom converts the hub version to this VirtualMachineClassList. +func (dst *VirtualMachineClassList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.VirtualMachineClassList) + return Convert_v1alpha3_VirtualMachineClassList_To_v1alpha2_VirtualMachineClassList(src, dst, nil) +} diff --git a/api/v1alpha2/virtualmachineclass_types.go b/api/v1alpha2/virtualmachineclass_types.go index 4ffa50032..04e70ad12 100644 --- a/api/v1alpha2/virtualmachineclass_types.go +++ b/api/v1alpha2/virtualmachineclass_types.go @@ -172,7 +172,6 @@ type VirtualMachineClassStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Namespaced,shortName=vmclass -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="CPU",type="string",JSONPath=".spec.hardware.cpus" // +kubebuilder:printcolumn:name="Memory",type="string",JSONPath=".spec.hardware.memory" diff --git a/api/v1alpha2/virtualmachineimage_conversion.go b/api/v1alpha2/virtualmachineimage_conversion.go index ebc1e604a..33671b8c9 100644 --- a/api/v1alpha2/virtualmachineimage_conversion.go +++ b/api/v1alpha2/virtualmachineimage_conversion.go @@ -1,16 +1,58 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package v1alpha2 -// Hub marks VirtualMachineImage as a conversion hub. -func (*VirtualMachineImage) Hub() {} +import ( + "sigs.k8s.io/controller-runtime/pkg/conversion" -// Hub marks VirtualMachineImageList as a conversion hub. -func (*VirtualMachineImageList) Hub() {} + "github.com/vmware-tanzu/vm-operator/api/v1alpha3" +) -// Hub marks ClusterVirtualMachineImage as a conversion hub. -func (*ClusterVirtualMachineImage) Hub() {} +// ConvertTo converts this VirtualMachineImage to the Hub version. +func (src *VirtualMachineImage) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.VirtualMachineImage) + return Convert_v1alpha2_VirtualMachineImage_To_v1alpha3_VirtualMachineImage(src, dst, nil) +} -// Hub marks ClusterVirtualMachineImageList as a conversion hub. -func (*ClusterVirtualMachineImageList) Hub() {} +// ConvertFrom converts the hub version to this VirtualMachineImage. +func (dst *VirtualMachineImage) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.VirtualMachineImage) + return Convert_v1alpha3_VirtualMachineImage_To_v1alpha2_VirtualMachineImage(src, dst, nil) +} + +// ConvertTo converts this VirtualMachineImageList to the Hub version. +func (src *VirtualMachineImageList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.VirtualMachineImageList) + return Convert_v1alpha2_VirtualMachineImageList_To_v1alpha3_VirtualMachineImageList(src, dst, nil) +} + +// ConvertFrom converts the hub version to this VirtualMachineImageList. +func (dst *VirtualMachineImageList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.VirtualMachineImageList) + return Convert_v1alpha3_VirtualMachineImageList_To_v1alpha2_VirtualMachineImageList(src, dst, nil) +} + +// ConvertTo converts this ClusterVirtualMachineImage to the Hub version. +func (src *ClusterVirtualMachineImage) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.ClusterVirtualMachineImage) + return Convert_v1alpha2_ClusterVirtualMachineImage_To_v1alpha3_ClusterVirtualMachineImage(src, dst, nil) +} + +// ConvertFrom converts the hub version to this ClusterVirtualMachineImage. +func (dst *ClusterVirtualMachineImage) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.ClusterVirtualMachineImage) + return Convert_v1alpha3_ClusterVirtualMachineImage_To_v1alpha2_ClusterVirtualMachineImage(src, dst, nil) +} + +// ConvertTo converts this ClusterVirtualMachineImageList to the Hub version. +func (src *ClusterVirtualMachineImageList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.ClusterVirtualMachineImageList) + return Convert_v1alpha2_ClusterVirtualMachineImageList_To_v1alpha3_ClusterVirtualMachineImageList(src, dst, nil) +} + +// ConvertFrom converts the hub version to this ClusterVirtualMachineImageList. +func (dst *ClusterVirtualMachineImageList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.ClusterVirtualMachineImageList) + return Convert_v1alpha3_ClusterVirtualMachineImageList_To_v1alpha2_ClusterVirtualMachineImageList(src, dst, nil) +} diff --git a/api/v1alpha2/virtualmachineimage_types.go b/api/v1alpha2/virtualmachineimage_types.go index cab727058..3dcccb23a 100644 --- a/api/v1alpha2/virtualmachineimage_types.go +++ b/api/v1alpha2/virtualmachineimage_types.go @@ -125,7 +125,7 @@ type VirtualMachineImageSpec struct { // this image's information. // // +optional - ProviderRef common.LocalObjectRef `json:"providerRef,omitempty"` + ProviderRef *common.LocalObjectRef `json:"providerRef,omitempty"` } // VirtualMachineImageStatus defines the observed state of VirtualMachineImage. @@ -214,7 +214,6 @@ type VirtualMachineImageStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Namespaced,shortName=vmi;vmimage -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Display Name",type="string",JSONPath=".status.name" // +kubebuilder:printcolumn:name="Image Version",type="string",JSONPath=".status.productInfo.version" @@ -251,7 +250,6 @@ type VirtualMachineImageList struct { // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Cluster,shortName=cvmi;cvmimage;clustervmi;clustervmimage -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Display Name",type="string",JSONPath=".status.name" // +kubebuilder:printcolumn:name="Image Version",type="string",JSONPath=".status.productInfo.version" diff --git a/api/v1alpha2/virtualmachinepublishrequest_conversion.go b/api/v1alpha2/virtualmachinepublishrequest_conversion.go index af8e6ca7b..002b09728 100644 --- a/api/v1alpha2/virtualmachinepublishrequest_conversion.go +++ b/api/v1alpha2/virtualmachinepublishrequest_conversion.go @@ -1,10 +1,34 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package v1alpha2 -// Hub marks VirtualMachinePublishRequest as a conversion hub. -func (*VirtualMachinePublishRequest) Hub() {} +import ( + "sigs.k8s.io/controller-runtime/pkg/conversion" -// Hub marks VirtualMachinePublishRequestList as a conversion hub. -func (*VirtualMachinePublishRequestList) Hub() {} + "github.com/vmware-tanzu/vm-operator/api/v1alpha3" +) + +// ConvertTo converts this VirtualMachinePublishRequest to the Hub version. +func (src *VirtualMachinePublishRequest) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.VirtualMachinePublishRequest) + return Convert_v1alpha2_VirtualMachinePublishRequest_To_v1alpha3_VirtualMachinePublishRequest(src, dst, nil) +} + +// ConvertFrom converts the hub version to this VirtualMachinePublishRequest. +func (dst *VirtualMachinePublishRequest) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.VirtualMachinePublishRequest) + return Convert_v1alpha3_VirtualMachinePublishRequest_To_v1alpha2_VirtualMachinePublishRequest(src, dst, nil) +} + +// ConvertTo converts this VirtualMachinePublishRequestList to the Hub version. +func (src *VirtualMachinePublishRequestList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.VirtualMachinePublishRequestList) + return Convert_v1alpha2_VirtualMachinePublishRequestList_To_v1alpha3_VirtualMachinePublishRequestList(src, dst, nil) +} + +// ConvertFrom converts the hub version to this VirtualMachinePublishRequestList. +func (dst *VirtualMachinePublishRequestList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.VirtualMachinePublishRequestList) + return Convert_v1alpha3_VirtualMachinePublishRequestList_To_v1alpha2_VirtualMachinePublishRequestList(src, dst, nil) +} diff --git a/api/v1alpha2/virtualmachinepublishrequest_types.go b/api/v1alpha2/virtualmachinepublishrequest_types.go index dc7e35730..9fec8beb1 100644 --- a/api/v1alpha2/virtualmachinepublishrequest_types.go +++ b/api/v1alpha2/virtualmachinepublishrequest_types.go @@ -334,7 +334,6 @@ type VirtualMachinePublishRequestStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Namespaced,shortName=vmpub -// +kubebuilder:storageversion // +kubebuilder:subresource:status // VirtualMachinePublishRequest defines the information necessary to publish a diff --git a/api/v1alpha2/virtualmachineservice_conversion.go b/api/v1alpha2/virtualmachineservice_conversion.go index a559627a0..e1cd89541 100644 --- a/api/v1alpha2/virtualmachineservice_conversion.go +++ b/api/v1alpha2/virtualmachineservice_conversion.go @@ -1,10 +1,34 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package v1alpha2 -// Hub marks VirtualMachineService as a conversion hub. -func (*VirtualMachineService) Hub() {} +import ( + "sigs.k8s.io/controller-runtime/pkg/conversion" -// Hub marks VirtualMachineServiceList as a conversion hub. -func (*VirtualMachineServiceList) Hub() {} + "github.com/vmware-tanzu/vm-operator/api/v1alpha3" +) + +// ConvertTo converts this VirtualMachineService to the Hub version. +func (src *VirtualMachineService) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.VirtualMachineService) + return Convert_v1alpha2_VirtualMachineService_To_v1alpha3_VirtualMachineService(src, dst, nil) +} + +// ConvertFrom converts the hub version to this VirtualMachineService. +func (dst *VirtualMachineService) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.VirtualMachineService) + return Convert_v1alpha3_VirtualMachineService_To_v1alpha2_VirtualMachineService(src, dst, nil) +} + +// ConvertTo converts this VirtualMachineServiceList to the Hub version. +func (src *VirtualMachineServiceList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.VirtualMachineServiceList) + return Convert_v1alpha2_VirtualMachineServiceList_To_v1alpha3_VirtualMachineServiceList(src, dst, nil) +} + +// ConvertFrom converts the hub version to this VirtualMachineServiceList. +func (dst *VirtualMachineServiceList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.VirtualMachineServiceList) + return Convert_v1alpha3_VirtualMachineServiceList_To_v1alpha2_VirtualMachineServiceList(src, dst, nil) +} diff --git a/api/v1alpha2/virtualmachineservice_types.go b/api/v1alpha2/virtualmachineservice_types.go index 60534526a..2fd01948d 100644 --- a/api/v1alpha2/virtualmachineservice_types.go +++ b/api/v1alpha2/virtualmachineservice_types.go @@ -142,7 +142,6 @@ type VirtualMachineServiceStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:shortName=vmservice -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".spec.type" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" diff --git a/api/v1alpha2/virtualmachinesetresourcepolicy_conversion.go b/api/v1alpha2/virtualmachinesetresourcepolicy_conversion.go index 498710215..042d022ab 100644 --- a/api/v1alpha2/virtualmachinesetresourcepolicy_conversion.go +++ b/api/v1alpha2/virtualmachinesetresourcepolicy_conversion.go @@ -1,10 +1,34 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package v1alpha2 -// Hub marks VirtualMachineSetResourcePolicy as a conversion hub. -func (*VirtualMachineSetResourcePolicy) Hub() {} +import ( + "sigs.k8s.io/controller-runtime/pkg/conversion" -// Hub marks VirtualMachineSetResourcePolicy as a conversion hub. -func (*VirtualMachineSetResourcePolicyList) Hub() {} + "github.com/vmware-tanzu/vm-operator/api/v1alpha3" +) + +// ConvertTo converts this VirtualMachineSetResourcePolicy to the Hub version. +func (src *VirtualMachineSetResourcePolicy) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.VirtualMachineSetResourcePolicy) + return Convert_v1alpha2_VirtualMachineSetResourcePolicy_To_v1alpha3_VirtualMachineSetResourcePolicy(src, dst, nil) +} + +// ConvertFrom converts the hub version to this VirtualMachineSetResourcePolicy. +func (dst *VirtualMachineSetResourcePolicy) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.VirtualMachineSetResourcePolicy) + return Convert_v1alpha3_VirtualMachineSetResourcePolicy_To_v1alpha2_VirtualMachineSetResourcePolicy(src, dst, nil) +} + +// ConvertTo converts this VirtualMachineSetResourcePolicyList to the Hub version. +func (src *VirtualMachineSetResourcePolicyList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.VirtualMachineSetResourcePolicyList) + return Convert_v1alpha2_VirtualMachineSetResourcePolicyList_To_v1alpha3_VirtualMachineSetResourcePolicyList(src, dst, nil) +} + +// ConvertFrom converts the hub version to this VirtualMachineSetResourcePolicyList. +func (dst *VirtualMachineSetResourcePolicyList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.VirtualMachineSetResourcePolicyList) + return Convert_v1alpha3_VirtualMachineSetResourcePolicyList_To_v1alpha2_VirtualMachineSetResourcePolicyList(src, dst, nil) +} diff --git a/api/v1alpha2/virtualmachinesetresourcepolicy_types.go b/api/v1alpha2/virtualmachinesetresourcepolicy_types.go index 0d7e9e62d..eb4e1395b 100644 --- a/api/v1alpha2/virtualmachinesetresourcepolicy_types.go +++ b/api/v1alpha2/virtualmachinesetresourcepolicy_types.go @@ -47,7 +47,6 @@ type VSphereClusterModuleStatus struct { } // +kubebuilder:object:root=true -// +kubebuilder:storageversion // +kubebuilder:subresource:status // VirtualMachineSetResourcePolicy is the Schema for the virtualmachinesetresourcepolicies API. diff --git a/api/v1alpha2/virtualmachinewebconsolerequest_conversion.go b/api/v1alpha2/virtualmachinewebconsolerequest_conversion.go new file mode 100644 index 000000000..698d8d2da --- /dev/null +++ b/api/v1alpha2/virtualmachinewebconsolerequest_conversion.go @@ -0,0 +1,34 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha2 + +import ( + "sigs.k8s.io/controller-runtime/pkg/conversion" + + "github.com/vmware-tanzu/vm-operator/api/v1alpha3" +) + +// ConvertTo converts this VirtualMachineWebConsoleRequest to the Hub version. +func (src *VirtualMachineWebConsoleRequest) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.VirtualMachineWebConsoleRequest) + return Convert_v1alpha2_VirtualMachineWebConsoleRequest_To_v1alpha3_VirtualMachineWebConsoleRequest(src, dst, nil) +} + +// ConvertFrom converts the hub version to this VirtualMachineWebConsoleRequest. +func (dst *VirtualMachineWebConsoleRequest) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.VirtualMachineWebConsoleRequest) + return Convert_v1alpha3_VirtualMachineWebConsoleRequest_To_v1alpha2_VirtualMachineWebConsoleRequest(src, dst, nil) +} + +// ConvertTo converts this VirtualMachineWebConsoleRequestList to the Hub version. +func (src *VirtualMachineWebConsoleRequestList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha3.VirtualMachineWebConsoleRequestList) + return Convert_v1alpha2_VirtualMachineWebConsoleRequestList_To_v1alpha3_VirtualMachineWebConsoleRequestList(src, dst, nil) +} + +// ConvertFrom converts the hub version to this VirtualMachineWebConsoleRequestList. +func (dst *VirtualMachineWebConsoleRequestList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha3.VirtualMachineWebConsoleRequestList) + return Convert_v1alpha3_VirtualMachineWebConsoleRequestList_To_v1alpha2_VirtualMachineWebConsoleRequestList(src, dst, nil) +} diff --git a/api/v1alpha2/virtualmachinewebconsolerequest_types.go b/api/v1alpha2/virtualmachinewebconsolerequest_types.go index 834b04162..82f2fca29 100644 --- a/api/v1alpha2/virtualmachinewebconsolerequest_types.go +++ b/api/v1alpha2/virtualmachinewebconsolerequest_types.go @@ -54,7 +54,6 @@ type VirtualMachineWebConsoleRequestStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Namespaced -// +kubebuilder:storageversion // +kubebuilder:subresource:status // VirtualMachineWebConsoleRequest allows the creation of a one-time, web diff --git a/api/v1alpha2/zz_generated.conversion.go b/api/v1alpha2/zz_generated.conversion.go new file mode 100644 index 000000000..805574326 --- /dev/null +++ b/api/v1alpha2/zz_generated.conversion.go @@ -0,0 +1,3300 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + json "encoding/json" + unsafe "unsafe" + + v1alpha2cloudinit "github.com/vmware-tanzu/vm-operator/api/v1alpha2/cloudinit" + v1alpha2common "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + v1alpha2sysprep "github.com/vmware-tanzu/vm-operator/api/v1alpha2/sysprep" + v1alpha3 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + cloudinit "github.com/vmware-tanzu/vm-operator/api/v1alpha3/cloudinit" + common "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" + sysprep "github.com/vmware-tanzu/vm-operator/api/v1alpha3/sysprep" + resource "k8s.io/apimachinery/pkg/api/resource" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*ClusterVirtualMachineImage)(nil), (*v1alpha3.ClusterVirtualMachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ClusterVirtualMachineImage_To_v1alpha3_ClusterVirtualMachineImage(a.(*ClusterVirtualMachineImage), b.(*v1alpha3.ClusterVirtualMachineImage), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ClusterVirtualMachineImage)(nil), (*ClusterVirtualMachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterVirtualMachineImage_To_v1alpha2_ClusterVirtualMachineImage(a.(*v1alpha3.ClusterVirtualMachineImage), b.(*ClusterVirtualMachineImage), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterVirtualMachineImageList)(nil), (*v1alpha3.ClusterVirtualMachineImageList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ClusterVirtualMachineImageList_To_v1alpha3_ClusterVirtualMachineImageList(a.(*ClusterVirtualMachineImageList), b.(*v1alpha3.ClusterVirtualMachineImageList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ClusterVirtualMachineImageList)(nil), (*ClusterVirtualMachineImageList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterVirtualMachineImageList_To_v1alpha2_ClusterVirtualMachineImageList(a.(*v1alpha3.ClusterVirtualMachineImageList), b.(*ClusterVirtualMachineImageList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*DynamicDirectPathIODevice)(nil), (*v1alpha3.DynamicDirectPathIODevice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_DynamicDirectPathIODevice_To_v1alpha3_DynamicDirectPathIODevice(a.(*DynamicDirectPathIODevice), b.(*v1alpha3.DynamicDirectPathIODevice), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DynamicDirectPathIODevice)(nil), (*DynamicDirectPathIODevice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DynamicDirectPathIODevice_To_v1alpha2_DynamicDirectPathIODevice(a.(*v1alpha3.DynamicDirectPathIODevice), b.(*DynamicDirectPathIODevice), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*GuestHeartbeatAction)(nil), (*v1alpha3.GuestHeartbeatAction)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_GuestHeartbeatAction_To_v1alpha3_GuestHeartbeatAction(a.(*GuestHeartbeatAction), b.(*v1alpha3.GuestHeartbeatAction), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.GuestHeartbeatAction)(nil), (*GuestHeartbeatAction)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_GuestHeartbeatAction_To_v1alpha2_GuestHeartbeatAction(a.(*v1alpha3.GuestHeartbeatAction), b.(*GuestHeartbeatAction), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*GuestInfoAction)(nil), (*v1alpha3.GuestInfoAction)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_GuestInfoAction_To_v1alpha3_GuestInfoAction(a.(*GuestInfoAction), b.(*v1alpha3.GuestInfoAction), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.GuestInfoAction)(nil), (*GuestInfoAction)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_GuestInfoAction_To_v1alpha2_GuestInfoAction(a.(*v1alpha3.GuestInfoAction), b.(*GuestInfoAction), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*InstanceStorage)(nil), (*v1alpha3.InstanceStorage)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_InstanceStorage_To_v1alpha3_InstanceStorage(a.(*InstanceStorage), b.(*v1alpha3.InstanceStorage), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.InstanceStorage)(nil), (*InstanceStorage)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_InstanceStorage_To_v1alpha2_InstanceStorage(a.(*v1alpha3.InstanceStorage), b.(*InstanceStorage), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*InstanceStorageVolume)(nil), (*v1alpha3.InstanceStorageVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_InstanceStorageVolume_To_v1alpha3_InstanceStorageVolume(a.(*InstanceStorageVolume), b.(*v1alpha3.InstanceStorageVolume), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.InstanceStorageVolume)(nil), (*InstanceStorageVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_InstanceStorageVolume_To_v1alpha2_InstanceStorageVolume(a.(*v1alpha3.InstanceStorageVolume), b.(*InstanceStorageVolume), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*InstanceVolumeClaimVolumeSource)(nil), (*v1alpha3.InstanceVolumeClaimVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_InstanceVolumeClaimVolumeSource_To_v1alpha3_InstanceVolumeClaimVolumeSource(a.(*InstanceVolumeClaimVolumeSource), b.(*v1alpha3.InstanceVolumeClaimVolumeSource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.InstanceVolumeClaimVolumeSource)(nil), (*InstanceVolumeClaimVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_InstanceVolumeClaimVolumeSource_To_v1alpha2_InstanceVolumeClaimVolumeSource(a.(*v1alpha3.InstanceVolumeClaimVolumeSource), b.(*InstanceVolumeClaimVolumeSource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*LoadBalancerIngress)(nil), (*v1alpha3.LoadBalancerIngress)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_LoadBalancerIngress_To_v1alpha3_LoadBalancerIngress(a.(*LoadBalancerIngress), b.(*v1alpha3.LoadBalancerIngress), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.LoadBalancerIngress)(nil), (*LoadBalancerIngress)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_LoadBalancerIngress_To_v1alpha2_LoadBalancerIngress(a.(*v1alpha3.LoadBalancerIngress), b.(*LoadBalancerIngress), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*LoadBalancerStatus)(nil), (*v1alpha3.LoadBalancerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_LoadBalancerStatus_To_v1alpha3_LoadBalancerStatus(a.(*LoadBalancerStatus), b.(*v1alpha3.LoadBalancerStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.LoadBalancerStatus)(nil), (*LoadBalancerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_LoadBalancerStatus_To_v1alpha2_LoadBalancerStatus(a.(*v1alpha3.LoadBalancerStatus), b.(*LoadBalancerStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*NetworkDeviceStatus)(nil), (*v1alpha3.NetworkDeviceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_NetworkDeviceStatus_To_v1alpha3_NetworkDeviceStatus(a.(*NetworkDeviceStatus), b.(*v1alpha3.NetworkDeviceStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.NetworkDeviceStatus)(nil), (*NetworkDeviceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_NetworkDeviceStatus_To_v1alpha2_NetworkDeviceStatus(a.(*v1alpha3.NetworkDeviceStatus), b.(*NetworkDeviceStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*NetworkStatus)(nil), (*v1alpha3.NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_NetworkStatus_To_v1alpha3_NetworkStatus(a.(*NetworkStatus), b.(*v1alpha3.NetworkStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.NetworkStatus)(nil), (*NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_NetworkStatus_To_v1alpha2_NetworkStatus(a.(*v1alpha3.NetworkStatus), b.(*NetworkStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*OVFProperty)(nil), (*v1alpha3.OVFProperty)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_OVFProperty_To_v1alpha3_OVFProperty(a.(*OVFProperty), b.(*v1alpha3.OVFProperty), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.OVFProperty)(nil), (*OVFProperty)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OVFProperty_To_v1alpha2_OVFProperty(a.(*v1alpha3.OVFProperty), b.(*OVFProperty), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*PersistentVolumeClaimVolumeSource)(nil), (*v1alpha3.PersistentVolumeClaimVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_PersistentVolumeClaimVolumeSource_To_v1alpha3_PersistentVolumeClaimVolumeSource(a.(*PersistentVolumeClaimVolumeSource), b.(*v1alpha3.PersistentVolumeClaimVolumeSource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.PersistentVolumeClaimVolumeSource)(nil), (*PersistentVolumeClaimVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_PersistentVolumeClaimVolumeSource_To_v1alpha2_PersistentVolumeClaimVolumeSource(a.(*v1alpha3.PersistentVolumeClaimVolumeSource), b.(*PersistentVolumeClaimVolumeSource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ResourcePoolSpec)(nil), (*v1alpha3.ResourcePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ResourcePoolSpec_To_v1alpha3_ResourcePoolSpec(a.(*ResourcePoolSpec), b.(*v1alpha3.ResourcePoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourcePoolSpec)(nil), (*ResourcePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourcePoolSpec_To_v1alpha2_ResourcePoolSpec(a.(*v1alpha3.ResourcePoolSpec), b.(*ResourcePoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*TCPSocketAction)(nil), (*v1alpha3.TCPSocketAction)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_TCPSocketAction_To_v1alpha3_TCPSocketAction(a.(*TCPSocketAction), b.(*v1alpha3.TCPSocketAction), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.TCPSocketAction)(nil), (*TCPSocketAction)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_TCPSocketAction_To_v1alpha2_TCPSocketAction(a.(*v1alpha3.TCPSocketAction), b.(*TCPSocketAction), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VGPUDevice)(nil), (*v1alpha3.VGPUDevice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VGPUDevice_To_v1alpha3_VGPUDevice(a.(*VGPUDevice), b.(*v1alpha3.VGPUDevice), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VGPUDevice)(nil), (*VGPUDevice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VGPUDevice_To_v1alpha2_VGPUDevice(a.(*v1alpha3.VGPUDevice), b.(*VGPUDevice), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VSphereClusterModuleStatus)(nil), (*v1alpha3.VSphereClusterModuleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VSphereClusterModuleStatus_To_v1alpha3_VSphereClusterModuleStatus(a.(*VSphereClusterModuleStatus), b.(*v1alpha3.VSphereClusterModuleStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VSphereClusterModuleStatus)(nil), (*VSphereClusterModuleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VSphereClusterModuleStatus_To_v1alpha2_VSphereClusterModuleStatus(a.(*v1alpha3.VSphereClusterModuleStatus), b.(*VSphereClusterModuleStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualDevices)(nil), (*v1alpha3.VirtualDevices)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualDevices_To_v1alpha3_VirtualDevices(a.(*VirtualDevices), b.(*v1alpha3.VirtualDevices), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualDevices)(nil), (*VirtualDevices)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualDevices_To_v1alpha2_VirtualDevices(a.(*v1alpha3.VirtualDevices), b.(*VirtualDevices), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachine)(nil), (*v1alpha3.VirtualMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachine_To_v1alpha3_VirtualMachine(a.(*VirtualMachine), b.(*v1alpha3.VirtualMachine), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachine)(nil), (*VirtualMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachine_To_v1alpha2_VirtualMachine(a.(*v1alpha3.VirtualMachine), b.(*VirtualMachine), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineAdvancedSpec)(nil), (*v1alpha3.VirtualMachineAdvancedSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineAdvancedSpec_To_v1alpha3_VirtualMachineAdvancedSpec(a.(*VirtualMachineAdvancedSpec), b.(*v1alpha3.VirtualMachineAdvancedSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineAdvancedSpec)(nil), (*VirtualMachineAdvancedSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineAdvancedSpec_To_v1alpha2_VirtualMachineAdvancedSpec(a.(*v1alpha3.VirtualMachineAdvancedSpec), b.(*VirtualMachineAdvancedSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineBootstrapCloudInitSpec)(nil), (*v1alpha3.VirtualMachineBootstrapCloudInitSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineBootstrapCloudInitSpec_To_v1alpha3_VirtualMachineBootstrapCloudInitSpec(a.(*VirtualMachineBootstrapCloudInitSpec), b.(*v1alpha3.VirtualMachineBootstrapCloudInitSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineBootstrapCloudInitSpec)(nil), (*VirtualMachineBootstrapCloudInitSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineBootstrapCloudInitSpec_To_v1alpha2_VirtualMachineBootstrapCloudInitSpec(a.(*v1alpha3.VirtualMachineBootstrapCloudInitSpec), b.(*VirtualMachineBootstrapCloudInitSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineBootstrapLinuxPrepSpec)(nil), (*v1alpha3.VirtualMachineBootstrapLinuxPrepSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineBootstrapLinuxPrepSpec_To_v1alpha3_VirtualMachineBootstrapLinuxPrepSpec(a.(*VirtualMachineBootstrapLinuxPrepSpec), b.(*v1alpha3.VirtualMachineBootstrapLinuxPrepSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineBootstrapLinuxPrepSpec)(nil), (*VirtualMachineBootstrapLinuxPrepSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineBootstrapLinuxPrepSpec_To_v1alpha2_VirtualMachineBootstrapLinuxPrepSpec(a.(*v1alpha3.VirtualMachineBootstrapLinuxPrepSpec), b.(*VirtualMachineBootstrapLinuxPrepSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineBootstrapSpec)(nil), (*v1alpha3.VirtualMachineBootstrapSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineBootstrapSpec_To_v1alpha3_VirtualMachineBootstrapSpec(a.(*VirtualMachineBootstrapSpec), b.(*v1alpha3.VirtualMachineBootstrapSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineBootstrapSpec)(nil), (*VirtualMachineBootstrapSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineBootstrapSpec_To_v1alpha2_VirtualMachineBootstrapSpec(a.(*v1alpha3.VirtualMachineBootstrapSpec), b.(*VirtualMachineBootstrapSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineBootstrapSysprepSpec)(nil), (*v1alpha3.VirtualMachineBootstrapSysprepSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineBootstrapSysprepSpec_To_v1alpha3_VirtualMachineBootstrapSysprepSpec(a.(*VirtualMachineBootstrapSysprepSpec), b.(*v1alpha3.VirtualMachineBootstrapSysprepSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineBootstrapSysprepSpec)(nil), (*VirtualMachineBootstrapSysprepSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineBootstrapSysprepSpec_To_v1alpha2_VirtualMachineBootstrapSysprepSpec(a.(*v1alpha3.VirtualMachineBootstrapSysprepSpec), b.(*VirtualMachineBootstrapSysprepSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineBootstrapVAppConfigSpec)(nil), (*v1alpha3.VirtualMachineBootstrapVAppConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineBootstrapVAppConfigSpec_To_v1alpha3_VirtualMachineBootstrapVAppConfigSpec(a.(*VirtualMachineBootstrapVAppConfigSpec), b.(*v1alpha3.VirtualMachineBootstrapVAppConfigSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineBootstrapVAppConfigSpec)(nil), (*VirtualMachineBootstrapVAppConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineBootstrapVAppConfigSpec_To_v1alpha2_VirtualMachineBootstrapVAppConfigSpec(a.(*v1alpha3.VirtualMachineBootstrapVAppConfigSpec), b.(*VirtualMachineBootstrapVAppConfigSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineClass)(nil), (*v1alpha3.VirtualMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineClass_To_v1alpha3_VirtualMachineClass(a.(*VirtualMachineClass), b.(*v1alpha3.VirtualMachineClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineClass)(nil), (*VirtualMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineClass_To_v1alpha2_VirtualMachineClass(a.(*v1alpha3.VirtualMachineClass), b.(*VirtualMachineClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineClassHardware)(nil), (*v1alpha3.VirtualMachineClassHardware)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineClassHardware_To_v1alpha3_VirtualMachineClassHardware(a.(*VirtualMachineClassHardware), b.(*v1alpha3.VirtualMachineClassHardware), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineClassHardware)(nil), (*VirtualMachineClassHardware)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineClassHardware_To_v1alpha2_VirtualMachineClassHardware(a.(*v1alpha3.VirtualMachineClassHardware), b.(*VirtualMachineClassHardware), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineClassList)(nil), (*v1alpha3.VirtualMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineClassList_To_v1alpha3_VirtualMachineClassList(a.(*VirtualMachineClassList), b.(*v1alpha3.VirtualMachineClassList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineClassList)(nil), (*VirtualMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineClassList_To_v1alpha2_VirtualMachineClassList(a.(*v1alpha3.VirtualMachineClassList), b.(*VirtualMachineClassList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineClassPolicies)(nil), (*v1alpha3.VirtualMachineClassPolicies)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineClassPolicies_To_v1alpha3_VirtualMachineClassPolicies(a.(*VirtualMachineClassPolicies), b.(*v1alpha3.VirtualMachineClassPolicies), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineClassPolicies)(nil), (*VirtualMachineClassPolicies)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineClassPolicies_To_v1alpha2_VirtualMachineClassPolicies(a.(*v1alpha3.VirtualMachineClassPolicies), b.(*VirtualMachineClassPolicies), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineClassResources)(nil), (*v1alpha3.VirtualMachineClassResources)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineClassResources_To_v1alpha3_VirtualMachineClassResources(a.(*VirtualMachineClassResources), b.(*v1alpha3.VirtualMachineClassResources), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineClassResources)(nil), (*VirtualMachineClassResources)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineClassResources_To_v1alpha2_VirtualMachineClassResources(a.(*v1alpha3.VirtualMachineClassResources), b.(*VirtualMachineClassResources), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineClassSpec)(nil), (*v1alpha3.VirtualMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineClassSpec_To_v1alpha3_VirtualMachineClassSpec(a.(*VirtualMachineClassSpec), b.(*v1alpha3.VirtualMachineClassSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineClassSpec)(nil), (*VirtualMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineClassSpec_To_v1alpha2_VirtualMachineClassSpec(a.(*v1alpha3.VirtualMachineClassSpec), b.(*VirtualMachineClassSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineClassStatus)(nil), (*v1alpha3.VirtualMachineClassStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineClassStatus_To_v1alpha3_VirtualMachineClassStatus(a.(*VirtualMachineClassStatus), b.(*v1alpha3.VirtualMachineClassStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineClassStatus)(nil), (*VirtualMachineClassStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineClassStatus_To_v1alpha2_VirtualMachineClassStatus(a.(*v1alpha3.VirtualMachineClassStatus), b.(*VirtualMachineClassStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineConfigSpec)(nil), (*v1alpha3.VirtualMachineConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineConfigSpec_To_v1alpha3_VirtualMachineConfigSpec(a.(*VirtualMachineConfigSpec), b.(*v1alpha3.VirtualMachineConfigSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineConfigSpec)(nil), (*VirtualMachineConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineConfigSpec_To_v1alpha2_VirtualMachineConfigSpec(a.(*v1alpha3.VirtualMachineConfigSpec), b.(*VirtualMachineConfigSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineImage)(nil), (*v1alpha3.VirtualMachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineImage_To_v1alpha3_VirtualMachineImage(a.(*VirtualMachineImage), b.(*v1alpha3.VirtualMachineImage), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineImage)(nil), (*VirtualMachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineImage_To_v1alpha2_VirtualMachineImage(a.(*v1alpha3.VirtualMachineImage), b.(*VirtualMachineImage), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineImageList)(nil), (*v1alpha3.VirtualMachineImageList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineImageList_To_v1alpha3_VirtualMachineImageList(a.(*VirtualMachineImageList), b.(*v1alpha3.VirtualMachineImageList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineImageList)(nil), (*VirtualMachineImageList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineImageList_To_v1alpha2_VirtualMachineImageList(a.(*v1alpha3.VirtualMachineImageList), b.(*VirtualMachineImageList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineImageOSInfo)(nil), (*v1alpha3.VirtualMachineImageOSInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineImageOSInfo_To_v1alpha3_VirtualMachineImageOSInfo(a.(*VirtualMachineImageOSInfo), b.(*v1alpha3.VirtualMachineImageOSInfo), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineImageOSInfo)(nil), (*VirtualMachineImageOSInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineImageOSInfo_To_v1alpha2_VirtualMachineImageOSInfo(a.(*v1alpha3.VirtualMachineImageOSInfo), b.(*VirtualMachineImageOSInfo), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineImageProductInfo)(nil), (*v1alpha3.VirtualMachineImageProductInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineImageProductInfo_To_v1alpha3_VirtualMachineImageProductInfo(a.(*VirtualMachineImageProductInfo), b.(*v1alpha3.VirtualMachineImageProductInfo), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineImageProductInfo)(nil), (*VirtualMachineImageProductInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineImageProductInfo_To_v1alpha2_VirtualMachineImageProductInfo(a.(*v1alpha3.VirtualMachineImageProductInfo), b.(*VirtualMachineImageProductInfo), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineImageSpec)(nil), (*v1alpha3.VirtualMachineImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageSpec(a.(*VirtualMachineImageSpec), b.(*v1alpha3.VirtualMachineImageSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineImageSpec)(nil), (*VirtualMachineImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSpec(a.(*v1alpha3.VirtualMachineImageSpec), b.(*VirtualMachineImageSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineImageStatus)(nil), (*v1alpha3.VirtualMachineImageStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha3_VirtualMachineImageStatus(a.(*VirtualMachineImageStatus), b.(*v1alpha3.VirtualMachineImageStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineImageStatus)(nil), (*VirtualMachineImageStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineImageStatus(a.(*v1alpha3.VirtualMachineImageStatus), b.(*VirtualMachineImageStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineList)(nil), (*v1alpha3.VirtualMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineList_To_v1alpha3_VirtualMachineList(a.(*VirtualMachineList), b.(*v1alpha3.VirtualMachineList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineList)(nil), (*VirtualMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineList_To_v1alpha2_VirtualMachineList(a.(*v1alpha3.VirtualMachineList), b.(*VirtualMachineList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkConfigDHCPOptionsStatus)(nil), (*v1alpha3.VirtualMachineNetworkConfigDHCPOptionsStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkConfigDHCPOptionsStatus_To_v1alpha3_VirtualMachineNetworkConfigDHCPOptionsStatus(a.(*VirtualMachineNetworkConfigDHCPOptionsStatus), b.(*v1alpha3.VirtualMachineNetworkConfigDHCPOptionsStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkConfigDHCPOptionsStatus)(nil), (*VirtualMachineNetworkConfigDHCPOptionsStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkConfigDHCPOptionsStatus_To_v1alpha2_VirtualMachineNetworkConfigDHCPOptionsStatus(a.(*v1alpha3.VirtualMachineNetworkConfigDHCPOptionsStatus), b.(*VirtualMachineNetworkConfigDHCPOptionsStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkConfigDHCPStatus)(nil), (*v1alpha3.VirtualMachineNetworkConfigDHCPStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkConfigDHCPStatus_To_v1alpha3_VirtualMachineNetworkConfigDHCPStatus(a.(*VirtualMachineNetworkConfigDHCPStatus), b.(*v1alpha3.VirtualMachineNetworkConfigDHCPStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkConfigDHCPStatus)(nil), (*VirtualMachineNetworkConfigDHCPStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkConfigDHCPStatus_To_v1alpha2_VirtualMachineNetworkConfigDHCPStatus(a.(*v1alpha3.VirtualMachineNetworkConfigDHCPStatus), b.(*VirtualMachineNetworkConfigDHCPStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkConfigDNSStatus)(nil), (*v1alpha3.VirtualMachineNetworkConfigDNSStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkConfigDNSStatus_To_v1alpha3_VirtualMachineNetworkConfigDNSStatus(a.(*VirtualMachineNetworkConfigDNSStatus), b.(*v1alpha3.VirtualMachineNetworkConfigDNSStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkConfigDNSStatus)(nil), (*VirtualMachineNetworkConfigDNSStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkConfigDNSStatus_To_v1alpha2_VirtualMachineNetworkConfigDNSStatus(a.(*v1alpha3.VirtualMachineNetworkConfigDNSStatus), b.(*VirtualMachineNetworkConfigDNSStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkConfigInterfaceIPStatus)(nil), (*v1alpha3.VirtualMachineNetworkConfigInterfaceIPStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkConfigInterfaceIPStatus_To_v1alpha3_VirtualMachineNetworkConfigInterfaceIPStatus(a.(*VirtualMachineNetworkConfigInterfaceIPStatus), b.(*v1alpha3.VirtualMachineNetworkConfigInterfaceIPStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkConfigInterfaceIPStatus)(nil), (*VirtualMachineNetworkConfigInterfaceIPStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkConfigInterfaceIPStatus_To_v1alpha2_VirtualMachineNetworkConfigInterfaceIPStatus(a.(*v1alpha3.VirtualMachineNetworkConfigInterfaceIPStatus), b.(*VirtualMachineNetworkConfigInterfaceIPStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkConfigInterfaceStatus)(nil), (*v1alpha3.VirtualMachineNetworkConfigInterfaceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkConfigInterfaceStatus_To_v1alpha3_VirtualMachineNetworkConfigInterfaceStatus(a.(*VirtualMachineNetworkConfigInterfaceStatus), b.(*v1alpha3.VirtualMachineNetworkConfigInterfaceStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkConfigInterfaceStatus)(nil), (*VirtualMachineNetworkConfigInterfaceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkConfigInterfaceStatus_To_v1alpha2_VirtualMachineNetworkConfigInterfaceStatus(a.(*v1alpha3.VirtualMachineNetworkConfigInterfaceStatus), b.(*VirtualMachineNetworkConfigInterfaceStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkConfigStatus)(nil), (*v1alpha3.VirtualMachineNetworkConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkConfigStatus_To_v1alpha3_VirtualMachineNetworkConfigStatus(a.(*VirtualMachineNetworkConfigStatus), b.(*v1alpha3.VirtualMachineNetworkConfigStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkConfigStatus)(nil), (*VirtualMachineNetworkConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkConfigStatus_To_v1alpha2_VirtualMachineNetworkConfigStatus(a.(*v1alpha3.VirtualMachineNetworkConfigStatus), b.(*VirtualMachineNetworkConfigStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkDHCPOptionsStatus)(nil), (*v1alpha3.VirtualMachineNetworkDHCPOptionsStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkDHCPOptionsStatus_To_v1alpha3_VirtualMachineNetworkDHCPOptionsStatus(a.(*VirtualMachineNetworkDHCPOptionsStatus), b.(*v1alpha3.VirtualMachineNetworkDHCPOptionsStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkDHCPOptionsStatus)(nil), (*VirtualMachineNetworkDHCPOptionsStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkDHCPOptionsStatus_To_v1alpha2_VirtualMachineNetworkDHCPOptionsStatus(a.(*v1alpha3.VirtualMachineNetworkDHCPOptionsStatus), b.(*VirtualMachineNetworkDHCPOptionsStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkDHCPStatus)(nil), (*v1alpha3.VirtualMachineNetworkDHCPStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkDHCPStatus_To_v1alpha3_VirtualMachineNetworkDHCPStatus(a.(*VirtualMachineNetworkDHCPStatus), b.(*v1alpha3.VirtualMachineNetworkDHCPStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkDHCPStatus)(nil), (*VirtualMachineNetworkDHCPStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkDHCPStatus_To_v1alpha2_VirtualMachineNetworkDHCPStatus(a.(*v1alpha3.VirtualMachineNetworkDHCPStatus), b.(*VirtualMachineNetworkDHCPStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkDNSStatus)(nil), (*v1alpha3.VirtualMachineNetworkDNSStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkDNSStatus_To_v1alpha3_VirtualMachineNetworkDNSStatus(a.(*VirtualMachineNetworkDNSStatus), b.(*v1alpha3.VirtualMachineNetworkDNSStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkDNSStatus)(nil), (*VirtualMachineNetworkDNSStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkDNSStatus_To_v1alpha2_VirtualMachineNetworkDNSStatus(a.(*v1alpha3.VirtualMachineNetworkDNSStatus), b.(*VirtualMachineNetworkDNSStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkIPRouteGatewayStatus)(nil), (*v1alpha3.VirtualMachineNetworkIPRouteGatewayStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkIPRouteGatewayStatus_To_v1alpha3_VirtualMachineNetworkIPRouteGatewayStatus(a.(*VirtualMachineNetworkIPRouteGatewayStatus), b.(*v1alpha3.VirtualMachineNetworkIPRouteGatewayStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkIPRouteGatewayStatus)(nil), (*VirtualMachineNetworkIPRouteGatewayStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkIPRouteGatewayStatus_To_v1alpha2_VirtualMachineNetworkIPRouteGatewayStatus(a.(*v1alpha3.VirtualMachineNetworkIPRouteGatewayStatus), b.(*VirtualMachineNetworkIPRouteGatewayStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkIPRouteStatus)(nil), (*v1alpha3.VirtualMachineNetworkIPRouteStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkIPRouteStatus_To_v1alpha3_VirtualMachineNetworkIPRouteStatus(a.(*VirtualMachineNetworkIPRouteStatus), b.(*v1alpha3.VirtualMachineNetworkIPRouteStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkIPRouteStatus)(nil), (*VirtualMachineNetworkIPRouteStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkIPRouteStatus_To_v1alpha2_VirtualMachineNetworkIPRouteStatus(a.(*v1alpha3.VirtualMachineNetworkIPRouteStatus), b.(*VirtualMachineNetworkIPRouteStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkIPStackStatus)(nil), (*v1alpha3.VirtualMachineNetworkIPStackStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkIPStackStatus_To_v1alpha3_VirtualMachineNetworkIPStackStatus(a.(*VirtualMachineNetworkIPStackStatus), b.(*v1alpha3.VirtualMachineNetworkIPStackStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkIPStackStatus)(nil), (*VirtualMachineNetworkIPStackStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkIPStackStatus_To_v1alpha2_VirtualMachineNetworkIPStackStatus(a.(*v1alpha3.VirtualMachineNetworkIPStackStatus), b.(*VirtualMachineNetworkIPStackStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkInterfaceIPAddrStatus)(nil), (*v1alpha3.VirtualMachineNetworkInterfaceIPAddrStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkInterfaceIPAddrStatus_To_v1alpha3_VirtualMachineNetworkInterfaceIPAddrStatus(a.(*VirtualMachineNetworkInterfaceIPAddrStatus), b.(*v1alpha3.VirtualMachineNetworkInterfaceIPAddrStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkInterfaceIPAddrStatus)(nil), (*VirtualMachineNetworkInterfaceIPAddrStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkInterfaceIPAddrStatus_To_v1alpha2_VirtualMachineNetworkInterfaceIPAddrStatus(a.(*v1alpha3.VirtualMachineNetworkInterfaceIPAddrStatus), b.(*VirtualMachineNetworkInterfaceIPAddrStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkInterfaceIPStatus)(nil), (*v1alpha3.VirtualMachineNetworkInterfaceIPStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkInterfaceIPStatus_To_v1alpha3_VirtualMachineNetworkInterfaceIPStatus(a.(*VirtualMachineNetworkInterfaceIPStatus), b.(*v1alpha3.VirtualMachineNetworkInterfaceIPStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkInterfaceIPStatus)(nil), (*VirtualMachineNetworkInterfaceIPStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkInterfaceIPStatus_To_v1alpha2_VirtualMachineNetworkInterfaceIPStatus(a.(*v1alpha3.VirtualMachineNetworkInterfaceIPStatus), b.(*VirtualMachineNetworkInterfaceIPStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkInterfaceSpec)(nil), (*v1alpha3.VirtualMachineNetworkInterfaceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkInterfaceSpec_To_v1alpha3_VirtualMachineNetworkInterfaceSpec(a.(*VirtualMachineNetworkInterfaceSpec), b.(*v1alpha3.VirtualMachineNetworkInterfaceSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkInterfaceSpec)(nil), (*VirtualMachineNetworkInterfaceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkInterfaceSpec_To_v1alpha2_VirtualMachineNetworkInterfaceSpec(a.(*v1alpha3.VirtualMachineNetworkInterfaceSpec), b.(*VirtualMachineNetworkInterfaceSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkInterfaceStatus)(nil), (*v1alpha3.VirtualMachineNetworkInterfaceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkInterfaceStatus_To_v1alpha3_VirtualMachineNetworkInterfaceStatus(a.(*VirtualMachineNetworkInterfaceStatus), b.(*v1alpha3.VirtualMachineNetworkInterfaceStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkInterfaceStatus)(nil), (*VirtualMachineNetworkInterfaceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkInterfaceStatus_To_v1alpha2_VirtualMachineNetworkInterfaceStatus(a.(*v1alpha3.VirtualMachineNetworkInterfaceStatus), b.(*VirtualMachineNetworkInterfaceStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkRouteSpec)(nil), (*v1alpha3.VirtualMachineNetworkRouteSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkRouteSpec_To_v1alpha3_VirtualMachineNetworkRouteSpec(a.(*VirtualMachineNetworkRouteSpec), b.(*v1alpha3.VirtualMachineNetworkRouteSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkRouteSpec)(nil), (*VirtualMachineNetworkRouteSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkRouteSpec_To_v1alpha2_VirtualMachineNetworkRouteSpec(a.(*v1alpha3.VirtualMachineNetworkRouteSpec), b.(*VirtualMachineNetworkRouteSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkRouteStatus)(nil), (*v1alpha3.VirtualMachineNetworkRouteStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkRouteStatus_To_v1alpha3_VirtualMachineNetworkRouteStatus(a.(*VirtualMachineNetworkRouteStatus), b.(*v1alpha3.VirtualMachineNetworkRouteStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkRouteStatus)(nil), (*VirtualMachineNetworkRouteStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkRouteStatus_To_v1alpha2_VirtualMachineNetworkRouteStatus(a.(*v1alpha3.VirtualMachineNetworkRouteStatus), b.(*VirtualMachineNetworkRouteStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkSpec)(nil), (*v1alpha3.VirtualMachineNetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkSpec_To_v1alpha3_VirtualMachineNetworkSpec(a.(*VirtualMachineNetworkSpec), b.(*v1alpha3.VirtualMachineNetworkSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkSpec)(nil), (*VirtualMachineNetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkSpec_To_v1alpha2_VirtualMachineNetworkSpec(a.(*v1alpha3.VirtualMachineNetworkSpec), b.(*VirtualMachineNetworkSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineNetworkStatus)(nil), (*v1alpha3.VirtualMachineNetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineNetworkStatus_To_v1alpha3_VirtualMachineNetworkStatus(a.(*VirtualMachineNetworkStatus), b.(*v1alpha3.VirtualMachineNetworkStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineNetworkStatus)(nil), (*VirtualMachineNetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineNetworkStatus_To_v1alpha2_VirtualMachineNetworkStatus(a.(*v1alpha3.VirtualMachineNetworkStatus), b.(*VirtualMachineNetworkStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequest)(nil), (*v1alpha3.VirtualMachinePublishRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachinePublishRequest_To_v1alpha3_VirtualMachinePublishRequest(a.(*VirtualMachinePublishRequest), b.(*v1alpha3.VirtualMachinePublishRequest), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequest)(nil), (*VirtualMachinePublishRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequest_To_v1alpha2_VirtualMachinePublishRequest(a.(*v1alpha3.VirtualMachinePublishRequest), b.(*VirtualMachinePublishRequest), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestList)(nil), (*v1alpha3.VirtualMachinePublishRequestList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachinePublishRequestList_To_v1alpha3_VirtualMachinePublishRequestList(a.(*VirtualMachinePublishRequestList), b.(*v1alpha3.VirtualMachinePublishRequestList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequestList)(nil), (*VirtualMachinePublishRequestList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequestList_To_v1alpha2_VirtualMachinePublishRequestList(a.(*v1alpha3.VirtualMachinePublishRequestList), b.(*VirtualMachinePublishRequestList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestSource)(nil), (*v1alpha3.VirtualMachinePublishRequestSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachinePublishRequestSource_To_v1alpha3_VirtualMachinePublishRequestSource(a.(*VirtualMachinePublishRequestSource), b.(*v1alpha3.VirtualMachinePublishRequestSource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequestSource)(nil), (*VirtualMachinePublishRequestSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequestSource_To_v1alpha2_VirtualMachinePublishRequestSource(a.(*v1alpha3.VirtualMachinePublishRequestSource), b.(*VirtualMachinePublishRequestSource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestSpec)(nil), (*v1alpha3.VirtualMachinePublishRequestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachinePublishRequestSpec_To_v1alpha3_VirtualMachinePublishRequestSpec(a.(*VirtualMachinePublishRequestSpec), b.(*v1alpha3.VirtualMachinePublishRequestSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequestSpec)(nil), (*VirtualMachinePublishRequestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequestSpec_To_v1alpha2_VirtualMachinePublishRequestSpec(a.(*v1alpha3.VirtualMachinePublishRequestSpec), b.(*VirtualMachinePublishRequestSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestStatus)(nil), (*v1alpha3.VirtualMachinePublishRequestStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachinePublishRequestStatus_To_v1alpha3_VirtualMachinePublishRequestStatus(a.(*VirtualMachinePublishRequestStatus), b.(*v1alpha3.VirtualMachinePublishRequestStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequestStatus)(nil), (*VirtualMachinePublishRequestStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequestStatus_To_v1alpha2_VirtualMachinePublishRequestStatus(a.(*v1alpha3.VirtualMachinePublishRequestStatus), b.(*VirtualMachinePublishRequestStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestTarget)(nil), (*v1alpha3.VirtualMachinePublishRequestTarget)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachinePublishRequestTarget_To_v1alpha3_VirtualMachinePublishRequestTarget(a.(*VirtualMachinePublishRequestTarget), b.(*v1alpha3.VirtualMachinePublishRequestTarget), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequestTarget)(nil), (*VirtualMachinePublishRequestTarget)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequestTarget_To_v1alpha2_VirtualMachinePublishRequestTarget(a.(*v1alpha3.VirtualMachinePublishRequestTarget), b.(*VirtualMachinePublishRequestTarget), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestTargetItem)(nil), (*v1alpha3.VirtualMachinePublishRequestTargetItem)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachinePublishRequestTargetItem_To_v1alpha3_VirtualMachinePublishRequestTargetItem(a.(*VirtualMachinePublishRequestTargetItem), b.(*v1alpha3.VirtualMachinePublishRequestTargetItem), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequestTargetItem)(nil), (*VirtualMachinePublishRequestTargetItem)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequestTargetItem_To_v1alpha2_VirtualMachinePublishRequestTargetItem(a.(*v1alpha3.VirtualMachinePublishRequestTargetItem), b.(*VirtualMachinePublishRequestTargetItem), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachinePublishRequestTargetLocation)(nil), (*v1alpha3.VirtualMachinePublishRequestTargetLocation)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachinePublishRequestTargetLocation_To_v1alpha3_VirtualMachinePublishRequestTargetLocation(a.(*VirtualMachinePublishRequestTargetLocation), b.(*v1alpha3.VirtualMachinePublishRequestTargetLocation), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachinePublishRequestTargetLocation)(nil), (*VirtualMachinePublishRequestTargetLocation)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachinePublishRequestTargetLocation_To_v1alpha2_VirtualMachinePublishRequestTargetLocation(a.(*v1alpha3.VirtualMachinePublishRequestTargetLocation), b.(*VirtualMachinePublishRequestTargetLocation), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineReadinessProbeSpec)(nil), (*v1alpha3.VirtualMachineReadinessProbeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineReadinessProbeSpec_To_v1alpha3_VirtualMachineReadinessProbeSpec(a.(*VirtualMachineReadinessProbeSpec), b.(*v1alpha3.VirtualMachineReadinessProbeSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineReadinessProbeSpec)(nil), (*VirtualMachineReadinessProbeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineReadinessProbeSpec_To_v1alpha2_VirtualMachineReadinessProbeSpec(a.(*v1alpha3.VirtualMachineReadinessProbeSpec), b.(*VirtualMachineReadinessProbeSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineReservedSpec)(nil), (*v1alpha3.VirtualMachineReservedSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineReservedSpec_To_v1alpha3_VirtualMachineReservedSpec(a.(*VirtualMachineReservedSpec), b.(*v1alpha3.VirtualMachineReservedSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineReservedSpec)(nil), (*VirtualMachineReservedSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineReservedSpec_To_v1alpha2_VirtualMachineReservedSpec(a.(*v1alpha3.VirtualMachineReservedSpec), b.(*VirtualMachineReservedSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineResourceSpec)(nil), (*v1alpha3.VirtualMachineResourceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(a.(*VirtualMachineResourceSpec), b.(*v1alpha3.VirtualMachineResourceSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineResourceSpec)(nil), (*VirtualMachineResourceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(a.(*v1alpha3.VirtualMachineResourceSpec), b.(*VirtualMachineResourceSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineService)(nil), (*v1alpha3.VirtualMachineService)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineService_To_v1alpha3_VirtualMachineService(a.(*VirtualMachineService), b.(*v1alpha3.VirtualMachineService), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineService)(nil), (*VirtualMachineService)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineService_To_v1alpha2_VirtualMachineService(a.(*v1alpha3.VirtualMachineService), b.(*VirtualMachineService), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineServiceList)(nil), (*v1alpha3.VirtualMachineServiceList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineServiceList_To_v1alpha3_VirtualMachineServiceList(a.(*VirtualMachineServiceList), b.(*v1alpha3.VirtualMachineServiceList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineServiceList)(nil), (*VirtualMachineServiceList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineServiceList_To_v1alpha2_VirtualMachineServiceList(a.(*v1alpha3.VirtualMachineServiceList), b.(*VirtualMachineServiceList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineServicePort)(nil), (*v1alpha3.VirtualMachineServicePort)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineServicePort_To_v1alpha3_VirtualMachineServicePort(a.(*VirtualMachineServicePort), b.(*v1alpha3.VirtualMachineServicePort), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineServicePort)(nil), (*VirtualMachineServicePort)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineServicePort_To_v1alpha2_VirtualMachineServicePort(a.(*v1alpha3.VirtualMachineServicePort), b.(*VirtualMachineServicePort), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineServiceSpec)(nil), (*v1alpha3.VirtualMachineServiceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineServiceSpec_To_v1alpha3_VirtualMachineServiceSpec(a.(*VirtualMachineServiceSpec), b.(*v1alpha3.VirtualMachineServiceSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineServiceSpec)(nil), (*VirtualMachineServiceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineServiceSpec_To_v1alpha2_VirtualMachineServiceSpec(a.(*v1alpha3.VirtualMachineServiceSpec), b.(*VirtualMachineServiceSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineServiceStatus)(nil), (*v1alpha3.VirtualMachineServiceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineServiceStatus_To_v1alpha3_VirtualMachineServiceStatus(a.(*VirtualMachineServiceStatus), b.(*v1alpha3.VirtualMachineServiceStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineServiceStatus)(nil), (*VirtualMachineServiceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineServiceStatus_To_v1alpha2_VirtualMachineServiceStatus(a.(*v1alpha3.VirtualMachineServiceStatus), b.(*VirtualMachineServiceStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineSetResourcePolicy)(nil), (*v1alpha3.VirtualMachineSetResourcePolicy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineSetResourcePolicy_To_v1alpha3_VirtualMachineSetResourcePolicy(a.(*VirtualMachineSetResourcePolicy), b.(*v1alpha3.VirtualMachineSetResourcePolicy), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineSetResourcePolicy)(nil), (*VirtualMachineSetResourcePolicy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineSetResourcePolicy_To_v1alpha2_VirtualMachineSetResourcePolicy(a.(*v1alpha3.VirtualMachineSetResourcePolicy), b.(*VirtualMachineSetResourcePolicy), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineSetResourcePolicyList)(nil), (*v1alpha3.VirtualMachineSetResourcePolicyList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineSetResourcePolicyList_To_v1alpha3_VirtualMachineSetResourcePolicyList(a.(*VirtualMachineSetResourcePolicyList), b.(*v1alpha3.VirtualMachineSetResourcePolicyList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineSetResourcePolicyList)(nil), (*VirtualMachineSetResourcePolicyList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineSetResourcePolicyList_To_v1alpha2_VirtualMachineSetResourcePolicyList(a.(*v1alpha3.VirtualMachineSetResourcePolicyList), b.(*VirtualMachineSetResourcePolicyList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineSetResourcePolicySpec)(nil), (*v1alpha3.VirtualMachineSetResourcePolicySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineSetResourcePolicySpec_To_v1alpha3_VirtualMachineSetResourcePolicySpec(a.(*VirtualMachineSetResourcePolicySpec), b.(*v1alpha3.VirtualMachineSetResourcePolicySpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineSetResourcePolicySpec)(nil), (*VirtualMachineSetResourcePolicySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineSetResourcePolicySpec_To_v1alpha2_VirtualMachineSetResourcePolicySpec(a.(*v1alpha3.VirtualMachineSetResourcePolicySpec), b.(*VirtualMachineSetResourcePolicySpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineSetResourcePolicyStatus)(nil), (*v1alpha3.VirtualMachineSetResourcePolicyStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineSetResourcePolicyStatus_To_v1alpha3_VirtualMachineSetResourcePolicyStatus(a.(*VirtualMachineSetResourcePolicyStatus), b.(*v1alpha3.VirtualMachineSetResourcePolicyStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineSetResourcePolicyStatus)(nil), (*VirtualMachineSetResourcePolicyStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineSetResourcePolicyStatus_To_v1alpha2_VirtualMachineSetResourcePolicyStatus(a.(*v1alpha3.VirtualMachineSetResourcePolicyStatus), b.(*VirtualMachineSetResourcePolicyStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineSpec)(nil), (*v1alpha3.VirtualMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineSpec_To_v1alpha3_VirtualMachineSpec(a.(*VirtualMachineSpec), b.(*v1alpha3.VirtualMachineSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineSpec)(nil), (*VirtualMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec(a.(*v1alpha3.VirtualMachineSpec), b.(*VirtualMachineSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineStatus)(nil), (*v1alpha3.VirtualMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineStatus_To_v1alpha3_VirtualMachineStatus(a.(*VirtualMachineStatus), b.(*v1alpha3.VirtualMachineStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineStatus)(nil), (*VirtualMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineStatus_To_v1alpha2_VirtualMachineStatus(a.(*v1alpha3.VirtualMachineStatus), b.(*VirtualMachineStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineTemplate)(nil), (*v1alpha3.VirtualMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineTemplate_To_v1alpha3_VirtualMachineTemplate(a.(*VirtualMachineTemplate), b.(*v1alpha3.VirtualMachineTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineTemplate)(nil), (*VirtualMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineTemplate_To_v1alpha2_VirtualMachineTemplate(a.(*v1alpha3.VirtualMachineTemplate), b.(*VirtualMachineTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineVolume)(nil), (*v1alpha3.VirtualMachineVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineVolume_To_v1alpha3_VirtualMachineVolume(a.(*VirtualMachineVolume), b.(*v1alpha3.VirtualMachineVolume), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineVolume)(nil), (*VirtualMachineVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineVolume_To_v1alpha2_VirtualMachineVolume(a.(*v1alpha3.VirtualMachineVolume), b.(*VirtualMachineVolume), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineVolumeSource)(nil), (*v1alpha3.VirtualMachineVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineVolumeSource_To_v1alpha3_VirtualMachineVolumeSource(a.(*VirtualMachineVolumeSource), b.(*v1alpha3.VirtualMachineVolumeSource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineVolumeSource)(nil), (*VirtualMachineVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineVolumeSource_To_v1alpha2_VirtualMachineVolumeSource(a.(*v1alpha3.VirtualMachineVolumeSource), b.(*VirtualMachineVolumeSource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineVolumeStatus)(nil), (*v1alpha3.VirtualMachineVolumeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineVolumeStatus_To_v1alpha3_VirtualMachineVolumeStatus(a.(*VirtualMachineVolumeStatus), b.(*v1alpha3.VirtualMachineVolumeStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineVolumeStatus)(nil), (*VirtualMachineVolumeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineVolumeStatus_To_v1alpha2_VirtualMachineVolumeStatus(a.(*v1alpha3.VirtualMachineVolumeStatus), b.(*VirtualMachineVolumeStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineWebConsoleRequest)(nil), (*v1alpha3.VirtualMachineWebConsoleRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineWebConsoleRequest_To_v1alpha3_VirtualMachineWebConsoleRequest(a.(*VirtualMachineWebConsoleRequest), b.(*v1alpha3.VirtualMachineWebConsoleRequest), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineWebConsoleRequest)(nil), (*VirtualMachineWebConsoleRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineWebConsoleRequest_To_v1alpha2_VirtualMachineWebConsoleRequest(a.(*v1alpha3.VirtualMachineWebConsoleRequest), b.(*VirtualMachineWebConsoleRequest), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineWebConsoleRequestList)(nil), (*v1alpha3.VirtualMachineWebConsoleRequestList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineWebConsoleRequestList_To_v1alpha3_VirtualMachineWebConsoleRequestList(a.(*VirtualMachineWebConsoleRequestList), b.(*v1alpha3.VirtualMachineWebConsoleRequestList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineWebConsoleRequestList)(nil), (*VirtualMachineWebConsoleRequestList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineWebConsoleRequestList_To_v1alpha2_VirtualMachineWebConsoleRequestList(a.(*v1alpha3.VirtualMachineWebConsoleRequestList), b.(*VirtualMachineWebConsoleRequestList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineWebConsoleRequestSpec)(nil), (*v1alpha3.VirtualMachineWebConsoleRequestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineWebConsoleRequestSpec_To_v1alpha3_VirtualMachineWebConsoleRequestSpec(a.(*VirtualMachineWebConsoleRequestSpec), b.(*v1alpha3.VirtualMachineWebConsoleRequestSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineWebConsoleRequestSpec)(nil), (*VirtualMachineWebConsoleRequestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineWebConsoleRequestSpec_To_v1alpha2_VirtualMachineWebConsoleRequestSpec(a.(*v1alpha3.VirtualMachineWebConsoleRequestSpec), b.(*VirtualMachineWebConsoleRequestSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualMachineWebConsoleRequestStatus)(nil), (*v1alpha3.VirtualMachineWebConsoleRequestStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineWebConsoleRequestStatus_To_v1alpha3_VirtualMachineWebConsoleRequestStatus(a.(*VirtualMachineWebConsoleRequestStatus), b.(*v1alpha3.VirtualMachineWebConsoleRequestStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachineWebConsoleRequestStatus)(nil), (*VirtualMachineWebConsoleRequestStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VirtualMachineWebConsoleRequestStatus_To_v1alpha2_VirtualMachineWebConsoleRequestStatus(a.(*v1alpha3.VirtualMachineWebConsoleRequestStatus), b.(*VirtualMachineWebConsoleRequestStatus), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha2_ClusterVirtualMachineImage_To_v1alpha3_ClusterVirtualMachineImage(in *ClusterVirtualMachineImage, out *v1alpha3.ClusterVirtualMachineImage, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha2_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha3_VirtualMachineImageStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_ClusterVirtualMachineImage_To_v1alpha3_ClusterVirtualMachineImage is an autogenerated conversion function. +func Convert_v1alpha2_ClusterVirtualMachineImage_To_v1alpha3_ClusterVirtualMachineImage(in *ClusterVirtualMachineImage, out *v1alpha3.ClusterVirtualMachineImage, s conversion.Scope) error { + return autoConvert_v1alpha2_ClusterVirtualMachineImage_To_v1alpha3_ClusterVirtualMachineImage(in, out, s) +} + +func autoConvert_v1alpha3_ClusterVirtualMachineImage_To_v1alpha2_ClusterVirtualMachineImage(in *v1alpha3.ClusterVirtualMachineImage, out *ClusterVirtualMachineImage, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha3_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineImageStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_ClusterVirtualMachineImage_To_v1alpha2_ClusterVirtualMachineImage is an autogenerated conversion function. +func Convert_v1alpha3_ClusterVirtualMachineImage_To_v1alpha2_ClusterVirtualMachineImage(in *v1alpha3.ClusterVirtualMachineImage, out *ClusterVirtualMachineImage, s conversion.Scope) error { + return autoConvert_v1alpha3_ClusterVirtualMachineImage_To_v1alpha2_ClusterVirtualMachineImage(in, out, s) +} + +func autoConvert_v1alpha2_ClusterVirtualMachineImageList_To_v1alpha3_ClusterVirtualMachineImageList(in *ClusterVirtualMachineImageList, out *v1alpha3.ClusterVirtualMachineImageList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha3.ClusterVirtualMachineImage)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha2_ClusterVirtualMachineImageList_To_v1alpha3_ClusterVirtualMachineImageList is an autogenerated conversion function. +func Convert_v1alpha2_ClusterVirtualMachineImageList_To_v1alpha3_ClusterVirtualMachineImageList(in *ClusterVirtualMachineImageList, out *v1alpha3.ClusterVirtualMachineImageList, s conversion.Scope) error { + return autoConvert_v1alpha2_ClusterVirtualMachineImageList_To_v1alpha3_ClusterVirtualMachineImageList(in, out, s) +} + +func autoConvert_v1alpha3_ClusterVirtualMachineImageList_To_v1alpha2_ClusterVirtualMachineImageList(in *v1alpha3.ClusterVirtualMachineImageList, out *ClusterVirtualMachineImageList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]ClusterVirtualMachineImage)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha3_ClusterVirtualMachineImageList_To_v1alpha2_ClusterVirtualMachineImageList is an autogenerated conversion function. +func Convert_v1alpha3_ClusterVirtualMachineImageList_To_v1alpha2_ClusterVirtualMachineImageList(in *v1alpha3.ClusterVirtualMachineImageList, out *ClusterVirtualMachineImageList, s conversion.Scope) error { + return autoConvert_v1alpha3_ClusterVirtualMachineImageList_To_v1alpha2_ClusterVirtualMachineImageList(in, out, s) +} + +func autoConvert_v1alpha2_DynamicDirectPathIODevice_To_v1alpha3_DynamicDirectPathIODevice(in *DynamicDirectPathIODevice, out *v1alpha3.DynamicDirectPathIODevice, s conversion.Scope) error { + out.VendorID = in.VendorID + out.DeviceID = in.DeviceID + out.CustomLabel = in.CustomLabel + return nil +} + +// Convert_v1alpha2_DynamicDirectPathIODevice_To_v1alpha3_DynamicDirectPathIODevice is an autogenerated conversion function. +func Convert_v1alpha2_DynamicDirectPathIODevice_To_v1alpha3_DynamicDirectPathIODevice(in *DynamicDirectPathIODevice, out *v1alpha3.DynamicDirectPathIODevice, s conversion.Scope) error { + return autoConvert_v1alpha2_DynamicDirectPathIODevice_To_v1alpha3_DynamicDirectPathIODevice(in, out, s) +} + +func autoConvert_v1alpha3_DynamicDirectPathIODevice_To_v1alpha2_DynamicDirectPathIODevice(in *v1alpha3.DynamicDirectPathIODevice, out *DynamicDirectPathIODevice, s conversion.Scope) error { + out.VendorID = in.VendorID + out.DeviceID = in.DeviceID + out.CustomLabel = in.CustomLabel + return nil +} + +// Convert_v1alpha3_DynamicDirectPathIODevice_To_v1alpha2_DynamicDirectPathIODevice is an autogenerated conversion function. +func Convert_v1alpha3_DynamicDirectPathIODevice_To_v1alpha2_DynamicDirectPathIODevice(in *v1alpha3.DynamicDirectPathIODevice, out *DynamicDirectPathIODevice, s conversion.Scope) error { + return autoConvert_v1alpha3_DynamicDirectPathIODevice_To_v1alpha2_DynamicDirectPathIODevice(in, out, s) +} + +func autoConvert_v1alpha2_GuestHeartbeatAction_To_v1alpha3_GuestHeartbeatAction(in *GuestHeartbeatAction, out *v1alpha3.GuestHeartbeatAction, s conversion.Scope) error { + out.ThresholdStatus = v1alpha3.GuestHeartbeatStatus(in.ThresholdStatus) + return nil +} + +// Convert_v1alpha2_GuestHeartbeatAction_To_v1alpha3_GuestHeartbeatAction is an autogenerated conversion function. +func Convert_v1alpha2_GuestHeartbeatAction_To_v1alpha3_GuestHeartbeatAction(in *GuestHeartbeatAction, out *v1alpha3.GuestHeartbeatAction, s conversion.Scope) error { + return autoConvert_v1alpha2_GuestHeartbeatAction_To_v1alpha3_GuestHeartbeatAction(in, out, s) +} + +func autoConvert_v1alpha3_GuestHeartbeatAction_To_v1alpha2_GuestHeartbeatAction(in *v1alpha3.GuestHeartbeatAction, out *GuestHeartbeatAction, s conversion.Scope) error { + out.ThresholdStatus = GuestHeartbeatStatus(in.ThresholdStatus) + return nil +} + +// Convert_v1alpha3_GuestHeartbeatAction_To_v1alpha2_GuestHeartbeatAction is an autogenerated conversion function. +func Convert_v1alpha3_GuestHeartbeatAction_To_v1alpha2_GuestHeartbeatAction(in *v1alpha3.GuestHeartbeatAction, out *GuestHeartbeatAction, s conversion.Scope) error { + return autoConvert_v1alpha3_GuestHeartbeatAction_To_v1alpha2_GuestHeartbeatAction(in, out, s) +} + +func autoConvert_v1alpha2_GuestInfoAction_To_v1alpha3_GuestInfoAction(in *GuestInfoAction, out *v1alpha3.GuestInfoAction, s conversion.Scope) error { + out.Key = in.Key + out.Value = in.Value + return nil +} + +// Convert_v1alpha2_GuestInfoAction_To_v1alpha3_GuestInfoAction is an autogenerated conversion function. +func Convert_v1alpha2_GuestInfoAction_To_v1alpha3_GuestInfoAction(in *GuestInfoAction, out *v1alpha3.GuestInfoAction, s conversion.Scope) error { + return autoConvert_v1alpha2_GuestInfoAction_To_v1alpha3_GuestInfoAction(in, out, s) +} + +func autoConvert_v1alpha3_GuestInfoAction_To_v1alpha2_GuestInfoAction(in *v1alpha3.GuestInfoAction, out *GuestInfoAction, s conversion.Scope) error { + out.Key = in.Key + out.Value = in.Value + return nil +} + +// Convert_v1alpha3_GuestInfoAction_To_v1alpha2_GuestInfoAction is an autogenerated conversion function. +func Convert_v1alpha3_GuestInfoAction_To_v1alpha2_GuestInfoAction(in *v1alpha3.GuestInfoAction, out *GuestInfoAction, s conversion.Scope) error { + return autoConvert_v1alpha3_GuestInfoAction_To_v1alpha2_GuestInfoAction(in, out, s) +} + +func autoConvert_v1alpha2_InstanceStorage_To_v1alpha3_InstanceStorage(in *InstanceStorage, out *v1alpha3.InstanceStorage, s conversion.Scope) error { + out.StorageClass = in.StorageClass + out.Volumes = *(*[]v1alpha3.InstanceStorageVolume)(unsafe.Pointer(&in.Volumes)) + return nil +} + +// Convert_v1alpha2_InstanceStorage_To_v1alpha3_InstanceStorage is an autogenerated conversion function. +func Convert_v1alpha2_InstanceStorage_To_v1alpha3_InstanceStorage(in *InstanceStorage, out *v1alpha3.InstanceStorage, s conversion.Scope) error { + return autoConvert_v1alpha2_InstanceStorage_To_v1alpha3_InstanceStorage(in, out, s) +} + +func autoConvert_v1alpha3_InstanceStorage_To_v1alpha2_InstanceStorage(in *v1alpha3.InstanceStorage, out *InstanceStorage, s conversion.Scope) error { + out.StorageClass = in.StorageClass + out.Volumes = *(*[]InstanceStorageVolume)(unsafe.Pointer(&in.Volumes)) + return nil +} + +// Convert_v1alpha3_InstanceStorage_To_v1alpha2_InstanceStorage is an autogenerated conversion function. +func Convert_v1alpha3_InstanceStorage_To_v1alpha2_InstanceStorage(in *v1alpha3.InstanceStorage, out *InstanceStorage, s conversion.Scope) error { + return autoConvert_v1alpha3_InstanceStorage_To_v1alpha2_InstanceStorage(in, out, s) +} + +func autoConvert_v1alpha2_InstanceStorageVolume_To_v1alpha3_InstanceStorageVolume(in *InstanceStorageVolume, out *v1alpha3.InstanceStorageVolume, s conversion.Scope) error { + out.Size = in.Size + return nil +} + +// Convert_v1alpha2_InstanceStorageVolume_To_v1alpha3_InstanceStorageVolume is an autogenerated conversion function. +func Convert_v1alpha2_InstanceStorageVolume_To_v1alpha3_InstanceStorageVolume(in *InstanceStorageVolume, out *v1alpha3.InstanceStorageVolume, s conversion.Scope) error { + return autoConvert_v1alpha2_InstanceStorageVolume_To_v1alpha3_InstanceStorageVolume(in, out, s) +} + +func autoConvert_v1alpha3_InstanceStorageVolume_To_v1alpha2_InstanceStorageVolume(in *v1alpha3.InstanceStorageVolume, out *InstanceStorageVolume, s conversion.Scope) error { + out.Size = in.Size + return nil +} + +// Convert_v1alpha3_InstanceStorageVolume_To_v1alpha2_InstanceStorageVolume is an autogenerated conversion function. +func Convert_v1alpha3_InstanceStorageVolume_To_v1alpha2_InstanceStorageVolume(in *v1alpha3.InstanceStorageVolume, out *InstanceStorageVolume, s conversion.Scope) error { + return autoConvert_v1alpha3_InstanceStorageVolume_To_v1alpha2_InstanceStorageVolume(in, out, s) +} + +func autoConvert_v1alpha2_InstanceVolumeClaimVolumeSource_To_v1alpha3_InstanceVolumeClaimVolumeSource(in *InstanceVolumeClaimVolumeSource, out *v1alpha3.InstanceVolumeClaimVolumeSource, s conversion.Scope) error { + out.StorageClass = in.StorageClass + out.Size = in.Size + return nil +} + +// Convert_v1alpha2_InstanceVolumeClaimVolumeSource_To_v1alpha3_InstanceVolumeClaimVolumeSource is an autogenerated conversion function. +func Convert_v1alpha2_InstanceVolumeClaimVolumeSource_To_v1alpha3_InstanceVolumeClaimVolumeSource(in *InstanceVolumeClaimVolumeSource, out *v1alpha3.InstanceVolumeClaimVolumeSource, s conversion.Scope) error { + return autoConvert_v1alpha2_InstanceVolumeClaimVolumeSource_To_v1alpha3_InstanceVolumeClaimVolumeSource(in, out, s) +} + +func autoConvert_v1alpha3_InstanceVolumeClaimVolumeSource_To_v1alpha2_InstanceVolumeClaimVolumeSource(in *v1alpha3.InstanceVolumeClaimVolumeSource, out *InstanceVolumeClaimVolumeSource, s conversion.Scope) error { + out.StorageClass = in.StorageClass + out.Size = in.Size + return nil +} + +// Convert_v1alpha3_InstanceVolumeClaimVolumeSource_To_v1alpha2_InstanceVolumeClaimVolumeSource is an autogenerated conversion function. +func Convert_v1alpha3_InstanceVolumeClaimVolumeSource_To_v1alpha2_InstanceVolumeClaimVolumeSource(in *v1alpha3.InstanceVolumeClaimVolumeSource, out *InstanceVolumeClaimVolumeSource, s conversion.Scope) error { + return autoConvert_v1alpha3_InstanceVolumeClaimVolumeSource_To_v1alpha2_InstanceVolumeClaimVolumeSource(in, out, s) +} + +func autoConvert_v1alpha2_LoadBalancerIngress_To_v1alpha3_LoadBalancerIngress(in *LoadBalancerIngress, out *v1alpha3.LoadBalancerIngress, s conversion.Scope) error { + out.IP = in.IP + out.Hostname = in.Hostname + return nil +} + +// Convert_v1alpha2_LoadBalancerIngress_To_v1alpha3_LoadBalancerIngress is an autogenerated conversion function. +func Convert_v1alpha2_LoadBalancerIngress_To_v1alpha3_LoadBalancerIngress(in *LoadBalancerIngress, out *v1alpha3.LoadBalancerIngress, s conversion.Scope) error { + return autoConvert_v1alpha2_LoadBalancerIngress_To_v1alpha3_LoadBalancerIngress(in, out, s) +} + +func autoConvert_v1alpha3_LoadBalancerIngress_To_v1alpha2_LoadBalancerIngress(in *v1alpha3.LoadBalancerIngress, out *LoadBalancerIngress, s conversion.Scope) error { + out.IP = in.IP + out.Hostname = in.Hostname + return nil +} + +// Convert_v1alpha3_LoadBalancerIngress_To_v1alpha2_LoadBalancerIngress is an autogenerated conversion function. +func Convert_v1alpha3_LoadBalancerIngress_To_v1alpha2_LoadBalancerIngress(in *v1alpha3.LoadBalancerIngress, out *LoadBalancerIngress, s conversion.Scope) error { + return autoConvert_v1alpha3_LoadBalancerIngress_To_v1alpha2_LoadBalancerIngress(in, out, s) +} + +func autoConvert_v1alpha2_LoadBalancerStatus_To_v1alpha3_LoadBalancerStatus(in *LoadBalancerStatus, out *v1alpha3.LoadBalancerStatus, s conversion.Scope) error { + out.Ingress = *(*[]v1alpha3.LoadBalancerIngress)(unsafe.Pointer(&in.Ingress)) + return nil +} + +// Convert_v1alpha2_LoadBalancerStatus_To_v1alpha3_LoadBalancerStatus is an autogenerated conversion function. +func Convert_v1alpha2_LoadBalancerStatus_To_v1alpha3_LoadBalancerStatus(in *LoadBalancerStatus, out *v1alpha3.LoadBalancerStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_LoadBalancerStatus_To_v1alpha3_LoadBalancerStatus(in, out, s) +} + +func autoConvert_v1alpha3_LoadBalancerStatus_To_v1alpha2_LoadBalancerStatus(in *v1alpha3.LoadBalancerStatus, out *LoadBalancerStatus, s conversion.Scope) error { + out.Ingress = *(*[]LoadBalancerIngress)(unsafe.Pointer(&in.Ingress)) + return nil +} + +// Convert_v1alpha3_LoadBalancerStatus_To_v1alpha2_LoadBalancerStatus is an autogenerated conversion function. +func Convert_v1alpha3_LoadBalancerStatus_To_v1alpha2_LoadBalancerStatus(in *v1alpha3.LoadBalancerStatus, out *LoadBalancerStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_LoadBalancerStatus_To_v1alpha2_LoadBalancerStatus(in, out, s) +} + +func autoConvert_v1alpha2_NetworkDeviceStatus_To_v1alpha3_NetworkDeviceStatus(in *NetworkDeviceStatus, out *v1alpha3.NetworkDeviceStatus, s conversion.Scope) error { + out.Gateway4 = in.Gateway4 + out.MacAddress = in.MacAddress + out.IPAddresses = *(*[]string)(unsafe.Pointer(&in.IPAddresses)) + return nil +} + +// Convert_v1alpha2_NetworkDeviceStatus_To_v1alpha3_NetworkDeviceStatus is an autogenerated conversion function. +func Convert_v1alpha2_NetworkDeviceStatus_To_v1alpha3_NetworkDeviceStatus(in *NetworkDeviceStatus, out *v1alpha3.NetworkDeviceStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_NetworkDeviceStatus_To_v1alpha3_NetworkDeviceStatus(in, out, s) +} + +func autoConvert_v1alpha3_NetworkDeviceStatus_To_v1alpha2_NetworkDeviceStatus(in *v1alpha3.NetworkDeviceStatus, out *NetworkDeviceStatus, s conversion.Scope) error { + out.Gateway4 = in.Gateway4 + out.MacAddress = in.MacAddress + out.IPAddresses = *(*[]string)(unsafe.Pointer(&in.IPAddresses)) + return nil +} + +// Convert_v1alpha3_NetworkDeviceStatus_To_v1alpha2_NetworkDeviceStatus is an autogenerated conversion function. +func Convert_v1alpha3_NetworkDeviceStatus_To_v1alpha2_NetworkDeviceStatus(in *v1alpha3.NetworkDeviceStatus, out *NetworkDeviceStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_NetworkDeviceStatus_To_v1alpha2_NetworkDeviceStatus(in, out, s) +} + +func autoConvert_v1alpha2_NetworkStatus_To_v1alpha3_NetworkStatus(in *NetworkStatus, out *v1alpha3.NetworkStatus, s conversion.Scope) error { + out.Devices = *(*[]v1alpha3.NetworkDeviceStatus)(unsafe.Pointer(&in.Devices)) + out.Nameservers = *(*[]string)(unsafe.Pointer(&in.Nameservers)) + return nil +} + +// Convert_v1alpha2_NetworkStatus_To_v1alpha3_NetworkStatus is an autogenerated conversion function. +func Convert_v1alpha2_NetworkStatus_To_v1alpha3_NetworkStatus(in *NetworkStatus, out *v1alpha3.NetworkStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_NetworkStatus_To_v1alpha3_NetworkStatus(in, out, s) +} + +func autoConvert_v1alpha3_NetworkStatus_To_v1alpha2_NetworkStatus(in *v1alpha3.NetworkStatus, out *NetworkStatus, s conversion.Scope) error { + out.Devices = *(*[]NetworkDeviceStatus)(unsafe.Pointer(&in.Devices)) + out.Nameservers = *(*[]string)(unsafe.Pointer(&in.Nameservers)) + return nil +} + +// Convert_v1alpha3_NetworkStatus_To_v1alpha2_NetworkStatus is an autogenerated conversion function. +func Convert_v1alpha3_NetworkStatus_To_v1alpha2_NetworkStatus(in *v1alpha3.NetworkStatus, out *NetworkStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_NetworkStatus_To_v1alpha2_NetworkStatus(in, out, s) +} + +func autoConvert_v1alpha2_OVFProperty_To_v1alpha3_OVFProperty(in *OVFProperty, out *v1alpha3.OVFProperty, s conversion.Scope) error { + out.Key = in.Key + out.Type = in.Type + out.Default = (*string)(unsafe.Pointer(in.Default)) + return nil +} + +// Convert_v1alpha2_OVFProperty_To_v1alpha3_OVFProperty is an autogenerated conversion function. +func Convert_v1alpha2_OVFProperty_To_v1alpha3_OVFProperty(in *OVFProperty, out *v1alpha3.OVFProperty, s conversion.Scope) error { + return autoConvert_v1alpha2_OVFProperty_To_v1alpha3_OVFProperty(in, out, s) +} + +func autoConvert_v1alpha3_OVFProperty_To_v1alpha2_OVFProperty(in *v1alpha3.OVFProperty, out *OVFProperty, s conversion.Scope) error { + out.Key = in.Key + out.Type = in.Type + out.Default = (*string)(unsafe.Pointer(in.Default)) + return nil +} + +// Convert_v1alpha3_OVFProperty_To_v1alpha2_OVFProperty is an autogenerated conversion function. +func Convert_v1alpha3_OVFProperty_To_v1alpha2_OVFProperty(in *v1alpha3.OVFProperty, out *OVFProperty, s conversion.Scope) error { + return autoConvert_v1alpha3_OVFProperty_To_v1alpha2_OVFProperty(in, out, s) +} + +func autoConvert_v1alpha2_PersistentVolumeClaimVolumeSource_To_v1alpha3_PersistentVolumeClaimVolumeSource(in *PersistentVolumeClaimVolumeSource, out *v1alpha3.PersistentVolumeClaimVolumeSource, s conversion.Scope) error { + out.PersistentVolumeClaimVolumeSource = in.PersistentVolumeClaimVolumeSource + out.InstanceVolumeClaim = (*v1alpha3.InstanceVolumeClaimVolumeSource)(unsafe.Pointer(in.InstanceVolumeClaim)) + return nil +} + +// Convert_v1alpha2_PersistentVolumeClaimVolumeSource_To_v1alpha3_PersistentVolumeClaimVolumeSource is an autogenerated conversion function. +func Convert_v1alpha2_PersistentVolumeClaimVolumeSource_To_v1alpha3_PersistentVolumeClaimVolumeSource(in *PersistentVolumeClaimVolumeSource, out *v1alpha3.PersistentVolumeClaimVolumeSource, s conversion.Scope) error { + return autoConvert_v1alpha2_PersistentVolumeClaimVolumeSource_To_v1alpha3_PersistentVolumeClaimVolumeSource(in, out, s) +} + +func autoConvert_v1alpha3_PersistentVolumeClaimVolumeSource_To_v1alpha2_PersistentVolumeClaimVolumeSource(in *v1alpha3.PersistentVolumeClaimVolumeSource, out *PersistentVolumeClaimVolumeSource, s conversion.Scope) error { + out.PersistentVolumeClaimVolumeSource = in.PersistentVolumeClaimVolumeSource + out.InstanceVolumeClaim = (*InstanceVolumeClaimVolumeSource)(unsafe.Pointer(in.InstanceVolumeClaim)) + return nil +} + +// Convert_v1alpha3_PersistentVolumeClaimVolumeSource_To_v1alpha2_PersistentVolumeClaimVolumeSource is an autogenerated conversion function. +func Convert_v1alpha3_PersistentVolumeClaimVolumeSource_To_v1alpha2_PersistentVolumeClaimVolumeSource(in *v1alpha3.PersistentVolumeClaimVolumeSource, out *PersistentVolumeClaimVolumeSource, s conversion.Scope) error { + return autoConvert_v1alpha3_PersistentVolumeClaimVolumeSource_To_v1alpha2_PersistentVolumeClaimVolumeSource(in, out, s) +} + +func autoConvert_v1alpha2_ResourcePoolSpec_To_v1alpha3_ResourcePoolSpec(in *ResourcePoolSpec, out *v1alpha3.ResourcePoolSpec, s conversion.Scope) error { + out.Name = in.Name + if err := Convert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(&in.Reservations, &out.Reservations, s); err != nil { + return err + } + if err := Convert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(&in.Limits, &out.Limits, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_ResourcePoolSpec_To_v1alpha3_ResourcePoolSpec is an autogenerated conversion function. +func Convert_v1alpha2_ResourcePoolSpec_To_v1alpha3_ResourcePoolSpec(in *ResourcePoolSpec, out *v1alpha3.ResourcePoolSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_ResourcePoolSpec_To_v1alpha3_ResourcePoolSpec(in, out, s) +} + +func autoConvert_v1alpha3_ResourcePoolSpec_To_v1alpha2_ResourcePoolSpec(in *v1alpha3.ResourcePoolSpec, out *ResourcePoolSpec, s conversion.Scope) error { + out.Name = in.Name + if err := Convert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(&in.Reservations, &out.Reservations, s); err != nil { + return err + } + if err := Convert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(&in.Limits, &out.Limits, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_ResourcePoolSpec_To_v1alpha2_ResourcePoolSpec is an autogenerated conversion function. +func Convert_v1alpha3_ResourcePoolSpec_To_v1alpha2_ResourcePoolSpec(in *v1alpha3.ResourcePoolSpec, out *ResourcePoolSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourcePoolSpec_To_v1alpha2_ResourcePoolSpec(in, out, s) +} + +func autoConvert_v1alpha2_TCPSocketAction_To_v1alpha3_TCPSocketAction(in *TCPSocketAction, out *v1alpha3.TCPSocketAction, s conversion.Scope) error { + out.Port = in.Port + out.Host = in.Host + return nil +} + +// Convert_v1alpha2_TCPSocketAction_To_v1alpha3_TCPSocketAction is an autogenerated conversion function. +func Convert_v1alpha2_TCPSocketAction_To_v1alpha3_TCPSocketAction(in *TCPSocketAction, out *v1alpha3.TCPSocketAction, s conversion.Scope) error { + return autoConvert_v1alpha2_TCPSocketAction_To_v1alpha3_TCPSocketAction(in, out, s) +} + +func autoConvert_v1alpha3_TCPSocketAction_To_v1alpha2_TCPSocketAction(in *v1alpha3.TCPSocketAction, out *TCPSocketAction, s conversion.Scope) error { + out.Port = in.Port + out.Host = in.Host + return nil +} + +// Convert_v1alpha3_TCPSocketAction_To_v1alpha2_TCPSocketAction is an autogenerated conversion function. +func Convert_v1alpha3_TCPSocketAction_To_v1alpha2_TCPSocketAction(in *v1alpha3.TCPSocketAction, out *TCPSocketAction, s conversion.Scope) error { + return autoConvert_v1alpha3_TCPSocketAction_To_v1alpha2_TCPSocketAction(in, out, s) +} + +func autoConvert_v1alpha2_VGPUDevice_To_v1alpha3_VGPUDevice(in *VGPUDevice, out *v1alpha3.VGPUDevice, s conversion.Scope) error { + out.ProfileName = in.ProfileName + return nil +} + +// Convert_v1alpha2_VGPUDevice_To_v1alpha3_VGPUDevice is an autogenerated conversion function. +func Convert_v1alpha2_VGPUDevice_To_v1alpha3_VGPUDevice(in *VGPUDevice, out *v1alpha3.VGPUDevice, s conversion.Scope) error { + return autoConvert_v1alpha2_VGPUDevice_To_v1alpha3_VGPUDevice(in, out, s) +} + +func autoConvert_v1alpha3_VGPUDevice_To_v1alpha2_VGPUDevice(in *v1alpha3.VGPUDevice, out *VGPUDevice, s conversion.Scope) error { + out.ProfileName = in.ProfileName + return nil +} + +// Convert_v1alpha3_VGPUDevice_To_v1alpha2_VGPUDevice is an autogenerated conversion function. +func Convert_v1alpha3_VGPUDevice_To_v1alpha2_VGPUDevice(in *v1alpha3.VGPUDevice, out *VGPUDevice, s conversion.Scope) error { + return autoConvert_v1alpha3_VGPUDevice_To_v1alpha2_VGPUDevice(in, out, s) +} + +func autoConvert_v1alpha2_VSphereClusterModuleStatus_To_v1alpha3_VSphereClusterModuleStatus(in *VSphereClusterModuleStatus, out *v1alpha3.VSphereClusterModuleStatus, s conversion.Scope) error { + out.GroupName = in.GroupName + out.ModuleUuid = in.ModuleUuid + out.ClusterMoID = in.ClusterMoID + return nil +} + +// Convert_v1alpha2_VSphereClusterModuleStatus_To_v1alpha3_VSphereClusterModuleStatus is an autogenerated conversion function. +func Convert_v1alpha2_VSphereClusterModuleStatus_To_v1alpha3_VSphereClusterModuleStatus(in *VSphereClusterModuleStatus, out *v1alpha3.VSphereClusterModuleStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VSphereClusterModuleStatus_To_v1alpha3_VSphereClusterModuleStatus(in, out, s) +} + +func autoConvert_v1alpha3_VSphereClusterModuleStatus_To_v1alpha2_VSphereClusterModuleStatus(in *v1alpha3.VSphereClusterModuleStatus, out *VSphereClusterModuleStatus, s conversion.Scope) error { + out.GroupName = in.GroupName + out.ModuleUuid = in.ModuleUuid + out.ClusterMoID = in.ClusterMoID + return nil +} + +// Convert_v1alpha3_VSphereClusterModuleStatus_To_v1alpha2_VSphereClusterModuleStatus is an autogenerated conversion function. +func Convert_v1alpha3_VSphereClusterModuleStatus_To_v1alpha2_VSphereClusterModuleStatus(in *v1alpha3.VSphereClusterModuleStatus, out *VSphereClusterModuleStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VSphereClusterModuleStatus_To_v1alpha2_VSphereClusterModuleStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualDevices_To_v1alpha3_VirtualDevices(in *VirtualDevices, out *v1alpha3.VirtualDevices, s conversion.Scope) error { + out.VGPUDevices = *(*[]v1alpha3.VGPUDevice)(unsafe.Pointer(&in.VGPUDevices)) + out.DynamicDirectPathIODevices = *(*[]v1alpha3.DynamicDirectPathIODevice)(unsafe.Pointer(&in.DynamicDirectPathIODevices)) + return nil +} + +// Convert_v1alpha2_VirtualDevices_To_v1alpha3_VirtualDevices is an autogenerated conversion function. +func Convert_v1alpha2_VirtualDevices_To_v1alpha3_VirtualDevices(in *VirtualDevices, out *v1alpha3.VirtualDevices, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualDevices_To_v1alpha3_VirtualDevices(in, out, s) +} + +func autoConvert_v1alpha3_VirtualDevices_To_v1alpha2_VirtualDevices(in *v1alpha3.VirtualDevices, out *VirtualDevices, s conversion.Scope) error { + out.VGPUDevices = *(*[]VGPUDevice)(unsafe.Pointer(&in.VGPUDevices)) + out.DynamicDirectPathIODevices = *(*[]DynamicDirectPathIODevice)(unsafe.Pointer(&in.DynamicDirectPathIODevices)) + return nil +} + +// Convert_v1alpha3_VirtualDevices_To_v1alpha2_VirtualDevices is an autogenerated conversion function. +func Convert_v1alpha3_VirtualDevices_To_v1alpha2_VirtualDevices(in *v1alpha3.VirtualDevices, out *VirtualDevices, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualDevices_To_v1alpha2_VirtualDevices(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachine_To_v1alpha3_VirtualMachine(in *VirtualMachine, out *v1alpha3.VirtualMachine, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha2_VirtualMachineSpec_To_v1alpha3_VirtualMachineSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha2_VirtualMachineStatus_To_v1alpha3_VirtualMachineStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_VirtualMachine_To_v1alpha3_VirtualMachine is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachine_To_v1alpha3_VirtualMachine(in *VirtualMachine, out *v1alpha3.VirtualMachine, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachine_To_v1alpha3_VirtualMachine(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachine_To_v1alpha2_VirtualMachine(in *v1alpha3.VirtualMachine, out *VirtualMachine, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha3_VirtualMachineStatus_To_v1alpha2_VirtualMachineStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_VirtualMachine_To_v1alpha2_VirtualMachine is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachine_To_v1alpha2_VirtualMachine(in *v1alpha3.VirtualMachine, out *VirtualMachine, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachine_To_v1alpha2_VirtualMachine(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineAdvancedSpec_To_v1alpha3_VirtualMachineAdvancedSpec(in *VirtualMachineAdvancedSpec, out *v1alpha3.VirtualMachineAdvancedSpec, s conversion.Scope) error { + out.BootDiskCapacity = (*resource.Quantity)(unsafe.Pointer(in.BootDiskCapacity)) + out.DefaultVolumeProvisioningMode = v1alpha3.VirtualMachineVolumeProvisioningMode(in.DefaultVolumeProvisioningMode) + out.ChangeBlockTracking = in.ChangeBlockTracking + return nil +} + +// Convert_v1alpha2_VirtualMachineAdvancedSpec_To_v1alpha3_VirtualMachineAdvancedSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineAdvancedSpec_To_v1alpha3_VirtualMachineAdvancedSpec(in *VirtualMachineAdvancedSpec, out *v1alpha3.VirtualMachineAdvancedSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineAdvancedSpec_To_v1alpha3_VirtualMachineAdvancedSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineAdvancedSpec_To_v1alpha2_VirtualMachineAdvancedSpec(in *v1alpha3.VirtualMachineAdvancedSpec, out *VirtualMachineAdvancedSpec, s conversion.Scope) error { + out.BootDiskCapacity = (*resource.Quantity)(unsafe.Pointer(in.BootDiskCapacity)) + out.DefaultVolumeProvisioningMode = VirtualMachineVolumeProvisioningMode(in.DefaultVolumeProvisioningMode) + out.ChangeBlockTracking = in.ChangeBlockTracking + return nil +} + +// Convert_v1alpha3_VirtualMachineAdvancedSpec_To_v1alpha2_VirtualMachineAdvancedSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineAdvancedSpec_To_v1alpha2_VirtualMachineAdvancedSpec(in *v1alpha3.VirtualMachineAdvancedSpec, out *VirtualMachineAdvancedSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineAdvancedSpec_To_v1alpha2_VirtualMachineAdvancedSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineBootstrapCloudInitSpec_To_v1alpha3_VirtualMachineBootstrapCloudInitSpec(in *VirtualMachineBootstrapCloudInitSpec, out *v1alpha3.VirtualMachineBootstrapCloudInitSpec, s conversion.Scope) error { + out.CloudConfig = (*cloudinit.CloudConfig)(unsafe.Pointer(in.CloudConfig)) + out.RawCloudConfig = (*common.SecretKeySelector)(unsafe.Pointer(in.RawCloudConfig)) + out.SSHAuthorizedKeys = *(*[]string)(unsafe.Pointer(&in.SSHAuthorizedKeys)) + return nil +} + +// Convert_v1alpha2_VirtualMachineBootstrapCloudInitSpec_To_v1alpha3_VirtualMachineBootstrapCloudInitSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineBootstrapCloudInitSpec_To_v1alpha3_VirtualMachineBootstrapCloudInitSpec(in *VirtualMachineBootstrapCloudInitSpec, out *v1alpha3.VirtualMachineBootstrapCloudInitSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineBootstrapCloudInitSpec_To_v1alpha3_VirtualMachineBootstrapCloudInitSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineBootstrapCloudInitSpec_To_v1alpha2_VirtualMachineBootstrapCloudInitSpec(in *v1alpha3.VirtualMachineBootstrapCloudInitSpec, out *VirtualMachineBootstrapCloudInitSpec, s conversion.Scope) error { + out.CloudConfig = (*v1alpha2cloudinit.CloudConfig)(unsafe.Pointer(in.CloudConfig)) + out.RawCloudConfig = (*v1alpha2common.SecretKeySelector)(unsafe.Pointer(in.RawCloudConfig)) + out.SSHAuthorizedKeys = *(*[]string)(unsafe.Pointer(&in.SSHAuthorizedKeys)) + return nil +} + +// Convert_v1alpha3_VirtualMachineBootstrapCloudInitSpec_To_v1alpha2_VirtualMachineBootstrapCloudInitSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineBootstrapCloudInitSpec_To_v1alpha2_VirtualMachineBootstrapCloudInitSpec(in *v1alpha3.VirtualMachineBootstrapCloudInitSpec, out *VirtualMachineBootstrapCloudInitSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineBootstrapCloudInitSpec_To_v1alpha2_VirtualMachineBootstrapCloudInitSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineBootstrapLinuxPrepSpec_To_v1alpha3_VirtualMachineBootstrapLinuxPrepSpec(in *VirtualMachineBootstrapLinuxPrepSpec, out *v1alpha3.VirtualMachineBootstrapLinuxPrepSpec, s conversion.Scope) error { + out.HardwareClockIsUTC = in.HardwareClockIsUTC + out.TimeZone = in.TimeZone + return nil +} + +// Convert_v1alpha2_VirtualMachineBootstrapLinuxPrepSpec_To_v1alpha3_VirtualMachineBootstrapLinuxPrepSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineBootstrapLinuxPrepSpec_To_v1alpha3_VirtualMachineBootstrapLinuxPrepSpec(in *VirtualMachineBootstrapLinuxPrepSpec, out *v1alpha3.VirtualMachineBootstrapLinuxPrepSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineBootstrapLinuxPrepSpec_To_v1alpha3_VirtualMachineBootstrapLinuxPrepSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineBootstrapLinuxPrepSpec_To_v1alpha2_VirtualMachineBootstrapLinuxPrepSpec(in *v1alpha3.VirtualMachineBootstrapLinuxPrepSpec, out *VirtualMachineBootstrapLinuxPrepSpec, s conversion.Scope) error { + out.HardwareClockIsUTC = in.HardwareClockIsUTC + out.TimeZone = in.TimeZone + return nil +} + +// Convert_v1alpha3_VirtualMachineBootstrapLinuxPrepSpec_To_v1alpha2_VirtualMachineBootstrapLinuxPrepSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineBootstrapLinuxPrepSpec_To_v1alpha2_VirtualMachineBootstrapLinuxPrepSpec(in *v1alpha3.VirtualMachineBootstrapLinuxPrepSpec, out *VirtualMachineBootstrapLinuxPrepSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineBootstrapLinuxPrepSpec_To_v1alpha2_VirtualMachineBootstrapLinuxPrepSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineBootstrapSpec_To_v1alpha3_VirtualMachineBootstrapSpec(in *VirtualMachineBootstrapSpec, out *v1alpha3.VirtualMachineBootstrapSpec, s conversion.Scope) error { + out.CloudInit = (*v1alpha3.VirtualMachineBootstrapCloudInitSpec)(unsafe.Pointer(in.CloudInit)) + out.LinuxPrep = (*v1alpha3.VirtualMachineBootstrapLinuxPrepSpec)(unsafe.Pointer(in.LinuxPrep)) + out.Sysprep = (*v1alpha3.VirtualMachineBootstrapSysprepSpec)(unsafe.Pointer(in.Sysprep)) + out.VAppConfig = (*v1alpha3.VirtualMachineBootstrapVAppConfigSpec)(unsafe.Pointer(in.VAppConfig)) + return nil +} + +// Convert_v1alpha2_VirtualMachineBootstrapSpec_To_v1alpha3_VirtualMachineBootstrapSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineBootstrapSpec_To_v1alpha3_VirtualMachineBootstrapSpec(in *VirtualMachineBootstrapSpec, out *v1alpha3.VirtualMachineBootstrapSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineBootstrapSpec_To_v1alpha3_VirtualMachineBootstrapSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineBootstrapSpec_To_v1alpha2_VirtualMachineBootstrapSpec(in *v1alpha3.VirtualMachineBootstrapSpec, out *VirtualMachineBootstrapSpec, s conversion.Scope) error { + out.CloudInit = (*VirtualMachineBootstrapCloudInitSpec)(unsafe.Pointer(in.CloudInit)) + out.LinuxPrep = (*VirtualMachineBootstrapLinuxPrepSpec)(unsafe.Pointer(in.LinuxPrep)) + out.Sysprep = (*VirtualMachineBootstrapSysprepSpec)(unsafe.Pointer(in.Sysprep)) + out.VAppConfig = (*VirtualMachineBootstrapVAppConfigSpec)(unsafe.Pointer(in.VAppConfig)) + return nil +} + +// Convert_v1alpha3_VirtualMachineBootstrapSpec_To_v1alpha2_VirtualMachineBootstrapSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineBootstrapSpec_To_v1alpha2_VirtualMachineBootstrapSpec(in *v1alpha3.VirtualMachineBootstrapSpec, out *VirtualMachineBootstrapSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineBootstrapSpec_To_v1alpha2_VirtualMachineBootstrapSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineBootstrapSysprepSpec_To_v1alpha3_VirtualMachineBootstrapSysprepSpec(in *VirtualMachineBootstrapSysprepSpec, out *v1alpha3.VirtualMachineBootstrapSysprepSpec, s conversion.Scope) error { + out.Sysprep = (*sysprep.Sysprep)(unsafe.Pointer(in.Sysprep)) + out.RawSysprep = (*common.SecretKeySelector)(unsafe.Pointer(in.RawSysprep)) + return nil +} + +// Convert_v1alpha2_VirtualMachineBootstrapSysprepSpec_To_v1alpha3_VirtualMachineBootstrapSysprepSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineBootstrapSysprepSpec_To_v1alpha3_VirtualMachineBootstrapSysprepSpec(in *VirtualMachineBootstrapSysprepSpec, out *v1alpha3.VirtualMachineBootstrapSysprepSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineBootstrapSysprepSpec_To_v1alpha3_VirtualMachineBootstrapSysprepSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineBootstrapSysprepSpec_To_v1alpha2_VirtualMachineBootstrapSysprepSpec(in *v1alpha3.VirtualMachineBootstrapSysprepSpec, out *VirtualMachineBootstrapSysprepSpec, s conversion.Scope) error { + out.Sysprep = (*v1alpha2sysprep.Sysprep)(unsafe.Pointer(in.Sysprep)) + out.RawSysprep = (*v1alpha2common.SecretKeySelector)(unsafe.Pointer(in.RawSysprep)) + return nil +} + +// Convert_v1alpha3_VirtualMachineBootstrapSysprepSpec_To_v1alpha2_VirtualMachineBootstrapSysprepSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineBootstrapSysprepSpec_To_v1alpha2_VirtualMachineBootstrapSysprepSpec(in *v1alpha3.VirtualMachineBootstrapSysprepSpec, out *VirtualMachineBootstrapSysprepSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineBootstrapSysprepSpec_To_v1alpha2_VirtualMachineBootstrapSysprepSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineBootstrapVAppConfigSpec_To_v1alpha3_VirtualMachineBootstrapVAppConfigSpec(in *VirtualMachineBootstrapVAppConfigSpec, out *v1alpha3.VirtualMachineBootstrapVAppConfigSpec, s conversion.Scope) error { + out.Properties = *(*[]common.KeyValueOrSecretKeySelectorPair)(unsafe.Pointer(&in.Properties)) + out.RawProperties = in.RawProperties + return nil +} + +// Convert_v1alpha2_VirtualMachineBootstrapVAppConfigSpec_To_v1alpha3_VirtualMachineBootstrapVAppConfigSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineBootstrapVAppConfigSpec_To_v1alpha3_VirtualMachineBootstrapVAppConfigSpec(in *VirtualMachineBootstrapVAppConfigSpec, out *v1alpha3.VirtualMachineBootstrapVAppConfigSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineBootstrapVAppConfigSpec_To_v1alpha3_VirtualMachineBootstrapVAppConfigSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineBootstrapVAppConfigSpec_To_v1alpha2_VirtualMachineBootstrapVAppConfigSpec(in *v1alpha3.VirtualMachineBootstrapVAppConfigSpec, out *VirtualMachineBootstrapVAppConfigSpec, s conversion.Scope) error { + out.Properties = *(*[]v1alpha2common.KeyValueOrSecretKeySelectorPair)(unsafe.Pointer(&in.Properties)) + out.RawProperties = in.RawProperties + return nil +} + +// Convert_v1alpha3_VirtualMachineBootstrapVAppConfigSpec_To_v1alpha2_VirtualMachineBootstrapVAppConfigSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineBootstrapVAppConfigSpec_To_v1alpha2_VirtualMachineBootstrapVAppConfigSpec(in *v1alpha3.VirtualMachineBootstrapVAppConfigSpec, out *VirtualMachineBootstrapVAppConfigSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineBootstrapVAppConfigSpec_To_v1alpha2_VirtualMachineBootstrapVAppConfigSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineClass_To_v1alpha3_VirtualMachineClass(in *VirtualMachineClass, out *v1alpha3.VirtualMachineClass, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha2_VirtualMachineClassSpec_To_v1alpha3_VirtualMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha2_VirtualMachineClassStatus_To_v1alpha3_VirtualMachineClassStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_VirtualMachineClass_To_v1alpha3_VirtualMachineClass is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineClass_To_v1alpha3_VirtualMachineClass(in *VirtualMachineClass, out *v1alpha3.VirtualMachineClass, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineClass_To_v1alpha3_VirtualMachineClass(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineClass_To_v1alpha2_VirtualMachineClass(in *v1alpha3.VirtualMachineClass, out *VirtualMachineClass, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_VirtualMachineClassSpec_To_v1alpha2_VirtualMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha3_VirtualMachineClassStatus_To_v1alpha2_VirtualMachineClassStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_VirtualMachineClass_To_v1alpha2_VirtualMachineClass is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineClass_To_v1alpha2_VirtualMachineClass(in *v1alpha3.VirtualMachineClass, out *VirtualMachineClass, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineClass_To_v1alpha2_VirtualMachineClass(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineClassHardware_To_v1alpha3_VirtualMachineClassHardware(in *VirtualMachineClassHardware, out *v1alpha3.VirtualMachineClassHardware, s conversion.Scope) error { + out.Cpus = in.Cpus + out.Memory = in.Memory + if err := Convert_v1alpha2_VirtualDevices_To_v1alpha3_VirtualDevices(&in.Devices, &out.Devices, s); err != nil { + return err + } + if err := Convert_v1alpha2_InstanceStorage_To_v1alpha3_InstanceStorage(&in.InstanceStorage, &out.InstanceStorage, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_VirtualMachineClassHardware_To_v1alpha3_VirtualMachineClassHardware is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineClassHardware_To_v1alpha3_VirtualMachineClassHardware(in *VirtualMachineClassHardware, out *v1alpha3.VirtualMachineClassHardware, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineClassHardware_To_v1alpha3_VirtualMachineClassHardware(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineClassHardware_To_v1alpha2_VirtualMachineClassHardware(in *v1alpha3.VirtualMachineClassHardware, out *VirtualMachineClassHardware, s conversion.Scope) error { + out.Cpus = in.Cpus + out.Memory = in.Memory + if err := Convert_v1alpha3_VirtualDevices_To_v1alpha2_VirtualDevices(&in.Devices, &out.Devices, s); err != nil { + return err + } + if err := Convert_v1alpha3_InstanceStorage_To_v1alpha2_InstanceStorage(&in.InstanceStorage, &out.InstanceStorage, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_VirtualMachineClassHardware_To_v1alpha2_VirtualMachineClassHardware is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineClassHardware_To_v1alpha2_VirtualMachineClassHardware(in *v1alpha3.VirtualMachineClassHardware, out *VirtualMachineClassHardware, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineClassHardware_To_v1alpha2_VirtualMachineClassHardware(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineClassList_To_v1alpha3_VirtualMachineClassList(in *VirtualMachineClassList, out *v1alpha3.VirtualMachineClassList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha3.VirtualMachineClass)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha2_VirtualMachineClassList_To_v1alpha3_VirtualMachineClassList is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineClassList_To_v1alpha3_VirtualMachineClassList(in *VirtualMachineClassList, out *v1alpha3.VirtualMachineClassList, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineClassList_To_v1alpha3_VirtualMachineClassList(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineClassList_To_v1alpha2_VirtualMachineClassList(in *v1alpha3.VirtualMachineClassList, out *VirtualMachineClassList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]VirtualMachineClass)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha3_VirtualMachineClassList_To_v1alpha2_VirtualMachineClassList is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineClassList_To_v1alpha2_VirtualMachineClassList(in *v1alpha3.VirtualMachineClassList, out *VirtualMachineClassList, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineClassList_To_v1alpha2_VirtualMachineClassList(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineClassPolicies_To_v1alpha3_VirtualMachineClassPolicies(in *VirtualMachineClassPolicies, out *v1alpha3.VirtualMachineClassPolicies, s conversion.Scope) error { + if err := Convert_v1alpha2_VirtualMachineClassResources_To_v1alpha3_VirtualMachineClassResources(&in.Resources, &out.Resources, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_VirtualMachineClassPolicies_To_v1alpha3_VirtualMachineClassPolicies is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineClassPolicies_To_v1alpha3_VirtualMachineClassPolicies(in *VirtualMachineClassPolicies, out *v1alpha3.VirtualMachineClassPolicies, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineClassPolicies_To_v1alpha3_VirtualMachineClassPolicies(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineClassPolicies_To_v1alpha2_VirtualMachineClassPolicies(in *v1alpha3.VirtualMachineClassPolicies, out *VirtualMachineClassPolicies, s conversion.Scope) error { + if err := Convert_v1alpha3_VirtualMachineClassResources_To_v1alpha2_VirtualMachineClassResources(&in.Resources, &out.Resources, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_VirtualMachineClassPolicies_To_v1alpha2_VirtualMachineClassPolicies is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineClassPolicies_To_v1alpha2_VirtualMachineClassPolicies(in *v1alpha3.VirtualMachineClassPolicies, out *VirtualMachineClassPolicies, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineClassPolicies_To_v1alpha2_VirtualMachineClassPolicies(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineClassResources_To_v1alpha3_VirtualMachineClassResources(in *VirtualMachineClassResources, out *v1alpha3.VirtualMachineClassResources, s conversion.Scope) error { + if err := Convert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(&in.Requests, &out.Requests, s); err != nil { + return err + } + if err := Convert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(&in.Limits, &out.Limits, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_VirtualMachineClassResources_To_v1alpha3_VirtualMachineClassResources is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineClassResources_To_v1alpha3_VirtualMachineClassResources(in *VirtualMachineClassResources, out *v1alpha3.VirtualMachineClassResources, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineClassResources_To_v1alpha3_VirtualMachineClassResources(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineClassResources_To_v1alpha2_VirtualMachineClassResources(in *v1alpha3.VirtualMachineClassResources, out *VirtualMachineClassResources, s conversion.Scope) error { + if err := Convert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(&in.Requests, &out.Requests, s); err != nil { + return err + } + if err := Convert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(&in.Limits, &out.Limits, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_VirtualMachineClassResources_To_v1alpha2_VirtualMachineClassResources is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineClassResources_To_v1alpha2_VirtualMachineClassResources(in *v1alpha3.VirtualMachineClassResources, out *VirtualMachineClassResources, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineClassResources_To_v1alpha2_VirtualMachineClassResources(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineClassSpec_To_v1alpha3_VirtualMachineClassSpec(in *VirtualMachineClassSpec, out *v1alpha3.VirtualMachineClassSpec, s conversion.Scope) error { + out.ControllerName = in.ControllerName + if err := Convert_v1alpha2_VirtualMachineClassHardware_To_v1alpha3_VirtualMachineClassHardware(&in.Hardware, &out.Hardware, s); err != nil { + return err + } + if err := Convert_v1alpha2_VirtualMachineClassPolicies_To_v1alpha3_VirtualMachineClassPolicies(&in.Policies, &out.Policies, s); err != nil { + return err + } + out.Description = in.Description + out.ConfigSpec = *(*json.RawMessage)(unsafe.Pointer(&in.ConfigSpec)) + return nil +} + +// Convert_v1alpha2_VirtualMachineClassSpec_To_v1alpha3_VirtualMachineClassSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineClassSpec_To_v1alpha3_VirtualMachineClassSpec(in *VirtualMachineClassSpec, out *v1alpha3.VirtualMachineClassSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineClassSpec_To_v1alpha3_VirtualMachineClassSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineClassSpec_To_v1alpha2_VirtualMachineClassSpec(in *v1alpha3.VirtualMachineClassSpec, out *VirtualMachineClassSpec, s conversion.Scope) error { + out.ControllerName = in.ControllerName + if err := Convert_v1alpha3_VirtualMachineClassHardware_To_v1alpha2_VirtualMachineClassHardware(&in.Hardware, &out.Hardware, s); err != nil { + return err + } + if err := Convert_v1alpha3_VirtualMachineClassPolicies_To_v1alpha2_VirtualMachineClassPolicies(&in.Policies, &out.Policies, s); err != nil { + return err + } + out.Description = in.Description + out.ConfigSpec = *(*json.RawMessage)(unsafe.Pointer(&in.ConfigSpec)) + return nil +} + +// Convert_v1alpha3_VirtualMachineClassSpec_To_v1alpha2_VirtualMachineClassSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineClassSpec_To_v1alpha2_VirtualMachineClassSpec(in *v1alpha3.VirtualMachineClassSpec, out *VirtualMachineClassSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineClassSpec_To_v1alpha2_VirtualMachineClassSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineClassStatus_To_v1alpha3_VirtualMachineClassStatus(in *VirtualMachineClassStatus, out *v1alpha3.VirtualMachineClassStatus, s conversion.Scope) error { + return nil +} + +// Convert_v1alpha2_VirtualMachineClassStatus_To_v1alpha3_VirtualMachineClassStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineClassStatus_To_v1alpha3_VirtualMachineClassStatus(in *VirtualMachineClassStatus, out *v1alpha3.VirtualMachineClassStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineClassStatus_To_v1alpha3_VirtualMachineClassStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineClassStatus_To_v1alpha2_VirtualMachineClassStatus(in *v1alpha3.VirtualMachineClassStatus, out *VirtualMachineClassStatus, s conversion.Scope) error { + return nil +} + +// Convert_v1alpha3_VirtualMachineClassStatus_To_v1alpha2_VirtualMachineClassStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineClassStatus_To_v1alpha2_VirtualMachineClassStatus(in *v1alpha3.VirtualMachineClassStatus, out *VirtualMachineClassStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineClassStatus_To_v1alpha2_VirtualMachineClassStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineConfigSpec_To_v1alpha3_VirtualMachineConfigSpec(in *VirtualMachineConfigSpec, out *v1alpha3.VirtualMachineConfigSpec, s conversion.Scope) error { + out.XML = in.XML + return nil +} + +// Convert_v1alpha2_VirtualMachineConfigSpec_To_v1alpha3_VirtualMachineConfigSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineConfigSpec_To_v1alpha3_VirtualMachineConfigSpec(in *VirtualMachineConfigSpec, out *v1alpha3.VirtualMachineConfigSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineConfigSpec_To_v1alpha3_VirtualMachineConfigSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineConfigSpec_To_v1alpha2_VirtualMachineConfigSpec(in *v1alpha3.VirtualMachineConfigSpec, out *VirtualMachineConfigSpec, s conversion.Scope) error { + out.XML = in.XML + return nil +} + +// Convert_v1alpha3_VirtualMachineConfigSpec_To_v1alpha2_VirtualMachineConfigSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineConfigSpec_To_v1alpha2_VirtualMachineConfigSpec(in *v1alpha3.VirtualMachineConfigSpec, out *VirtualMachineConfigSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineConfigSpec_To_v1alpha2_VirtualMachineConfigSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineImage_To_v1alpha3_VirtualMachineImage(in *VirtualMachineImage, out *v1alpha3.VirtualMachineImage, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha2_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha3_VirtualMachineImageStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_VirtualMachineImage_To_v1alpha3_VirtualMachineImage is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineImage_To_v1alpha3_VirtualMachineImage(in *VirtualMachineImage, out *v1alpha3.VirtualMachineImage, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineImage_To_v1alpha3_VirtualMachineImage(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineImage_To_v1alpha2_VirtualMachineImage(in *v1alpha3.VirtualMachineImage, out *VirtualMachineImage, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha3_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineImageStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_VirtualMachineImage_To_v1alpha2_VirtualMachineImage is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineImage_To_v1alpha2_VirtualMachineImage(in *v1alpha3.VirtualMachineImage, out *VirtualMachineImage, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineImage_To_v1alpha2_VirtualMachineImage(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineImageList_To_v1alpha3_VirtualMachineImageList(in *VirtualMachineImageList, out *v1alpha3.VirtualMachineImageList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha3.VirtualMachineImage)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha2_VirtualMachineImageList_To_v1alpha3_VirtualMachineImageList is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineImageList_To_v1alpha3_VirtualMachineImageList(in *VirtualMachineImageList, out *v1alpha3.VirtualMachineImageList, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineImageList_To_v1alpha3_VirtualMachineImageList(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineImageList_To_v1alpha2_VirtualMachineImageList(in *v1alpha3.VirtualMachineImageList, out *VirtualMachineImageList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]VirtualMachineImage)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha3_VirtualMachineImageList_To_v1alpha2_VirtualMachineImageList is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineImageList_To_v1alpha2_VirtualMachineImageList(in *v1alpha3.VirtualMachineImageList, out *VirtualMachineImageList, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineImageList_To_v1alpha2_VirtualMachineImageList(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineImageOSInfo_To_v1alpha3_VirtualMachineImageOSInfo(in *VirtualMachineImageOSInfo, out *v1alpha3.VirtualMachineImageOSInfo, s conversion.Scope) error { + out.ID = in.ID + out.Type = in.Type + out.Version = in.Version + return nil +} + +// Convert_v1alpha2_VirtualMachineImageOSInfo_To_v1alpha3_VirtualMachineImageOSInfo is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineImageOSInfo_To_v1alpha3_VirtualMachineImageOSInfo(in *VirtualMachineImageOSInfo, out *v1alpha3.VirtualMachineImageOSInfo, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineImageOSInfo_To_v1alpha3_VirtualMachineImageOSInfo(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineImageOSInfo_To_v1alpha2_VirtualMachineImageOSInfo(in *v1alpha3.VirtualMachineImageOSInfo, out *VirtualMachineImageOSInfo, s conversion.Scope) error { + out.ID = in.ID + out.Type = in.Type + out.Version = in.Version + return nil +} + +// Convert_v1alpha3_VirtualMachineImageOSInfo_To_v1alpha2_VirtualMachineImageOSInfo is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineImageOSInfo_To_v1alpha2_VirtualMachineImageOSInfo(in *v1alpha3.VirtualMachineImageOSInfo, out *VirtualMachineImageOSInfo, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineImageOSInfo_To_v1alpha2_VirtualMachineImageOSInfo(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineImageProductInfo_To_v1alpha3_VirtualMachineImageProductInfo(in *VirtualMachineImageProductInfo, out *v1alpha3.VirtualMachineImageProductInfo, s conversion.Scope) error { + out.Product = in.Product + out.Vendor = in.Vendor + out.Version = in.Version + out.FullVersion = in.FullVersion + return nil +} + +// Convert_v1alpha2_VirtualMachineImageProductInfo_To_v1alpha3_VirtualMachineImageProductInfo is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineImageProductInfo_To_v1alpha3_VirtualMachineImageProductInfo(in *VirtualMachineImageProductInfo, out *v1alpha3.VirtualMachineImageProductInfo, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineImageProductInfo_To_v1alpha3_VirtualMachineImageProductInfo(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineImageProductInfo_To_v1alpha2_VirtualMachineImageProductInfo(in *v1alpha3.VirtualMachineImageProductInfo, out *VirtualMachineImageProductInfo, s conversion.Scope) error { + out.Product = in.Product + out.Vendor = in.Vendor + out.Version = in.Version + out.FullVersion = in.FullVersion + return nil +} + +// Convert_v1alpha3_VirtualMachineImageProductInfo_To_v1alpha2_VirtualMachineImageProductInfo is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineImageProductInfo_To_v1alpha2_VirtualMachineImageProductInfo(in *v1alpha3.VirtualMachineImageProductInfo, out *VirtualMachineImageProductInfo, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineImageProductInfo_To_v1alpha2_VirtualMachineImageProductInfo(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageSpec(in *VirtualMachineImageSpec, out *v1alpha3.VirtualMachineImageSpec, s conversion.Scope) error { + out.ProviderRef = (*common.LocalObjectRef)(unsafe.Pointer(in.ProviderRef)) + return nil +} + +// Convert_v1alpha2_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageSpec(in *VirtualMachineImageSpec, out *v1alpha3.VirtualMachineImageSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineImageSpec_To_v1alpha3_VirtualMachineImageSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSpec(in *v1alpha3.VirtualMachineImageSpec, out *VirtualMachineImageSpec, s conversion.Scope) error { + out.ProviderRef = (*v1alpha2common.LocalObjectRef)(unsafe.Pointer(in.ProviderRef)) + return nil +} + +// Convert_v1alpha3_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSpec(in *v1alpha3.VirtualMachineImageSpec, out *VirtualMachineImageSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineImageSpec_To_v1alpha2_VirtualMachineImageSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineImageStatus_To_v1alpha3_VirtualMachineImageStatus(in *VirtualMachineImageStatus, out *v1alpha3.VirtualMachineImageStatus, s conversion.Scope) error { + out.Name = in.Name + out.Capabilities = *(*[]string)(unsafe.Pointer(&in.Capabilities)) + out.Firmware = in.Firmware + out.HardwareVersion = (*int32)(unsafe.Pointer(in.HardwareVersion)) + if err := Convert_v1alpha2_VirtualMachineImageOSInfo_To_v1alpha3_VirtualMachineImageOSInfo(&in.OSInfo, &out.OSInfo, s); err != nil { + return err + } + out.OVFProperties = *(*[]v1alpha3.OVFProperty)(unsafe.Pointer(&in.OVFProperties)) + out.VMwareSystemProperties = *(*[]common.KeyValuePair)(unsafe.Pointer(&in.VMwareSystemProperties)) + if err := Convert_v1alpha2_VirtualMachineImageProductInfo_To_v1alpha3_VirtualMachineImageProductInfo(&in.ProductInfo, &out.ProductInfo, s); err != nil { + return err + } + out.ProviderContentVersion = in.ProviderContentVersion + out.ProviderItemID = in.ProviderItemID + out.Conditions = *(*[]v1.Condition)(unsafe.Pointer(&in.Conditions)) + return nil +} + +// Convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha3_VirtualMachineImageStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineImageStatus_To_v1alpha3_VirtualMachineImageStatus(in *VirtualMachineImageStatus, out *v1alpha3.VirtualMachineImageStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineImageStatus_To_v1alpha3_VirtualMachineImageStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineImageStatus(in *v1alpha3.VirtualMachineImageStatus, out *VirtualMachineImageStatus, s conversion.Scope) error { + out.Name = in.Name + out.Capabilities = *(*[]string)(unsafe.Pointer(&in.Capabilities)) + out.Firmware = in.Firmware + out.HardwareVersion = (*int32)(unsafe.Pointer(in.HardwareVersion)) + if err := Convert_v1alpha3_VirtualMachineImageOSInfo_To_v1alpha2_VirtualMachineImageOSInfo(&in.OSInfo, &out.OSInfo, s); err != nil { + return err + } + out.OVFProperties = *(*[]OVFProperty)(unsafe.Pointer(&in.OVFProperties)) + out.VMwareSystemProperties = *(*[]v1alpha2common.KeyValuePair)(unsafe.Pointer(&in.VMwareSystemProperties)) + if err := Convert_v1alpha3_VirtualMachineImageProductInfo_To_v1alpha2_VirtualMachineImageProductInfo(&in.ProductInfo, &out.ProductInfo, s); err != nil { + return err + } + out.ProviderContentVersion = in.ProviderContentVersion + out.ProviderItemID = in.ProviderItemID + out.Conditions = *(*[]v1.Condition)(unsafe.Pointer(&in.Conditions)) + return nil +} + +// Convert_v1alpha3_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineImageStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineImageStatus(in *v1alpha3.VirtualMachineImageStatus, out *VirtualMachineImageStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineImageStatus_To_v1alpha2_VirtualMachineImageStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineList_To_v1alpha3_VirtualMachineList(in *VirtualMachineList, out *v1alpha3.VirtualMachineList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha3.VirtualMachine)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha2_VirtualMachineList_To_v1alpha3_VirtualMachineList is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineList_To_v1alpha3_VirtualMachineList(in *VirtualMachineList, out *v1alpha3.VirtualMachineList, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineList_To_v1alpha3_VirtualMachineList(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineList_To_v1alpha2_VirtualMachineList(in *v1alpha3.VirtualMachineList, out *VirtualMachineList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]VirtualMachine)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha3_VirtualMachineList_To_v1alpha2_VirtualMachineList is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineList_To_v1alpha2_VirtualMachineList(in *v1alpha3.VirtualMachineList, out *VirtualMachineList, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineList_To_v1alpha2_VirtualMachineList(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkConfigDHCPOptionsStatus_To_v1alpha3_VirtualMachineNetworkConfigDHCPOptionsStatus(in *VirtualMachineNetworkConfigDHCPOptionsStatus, out *v1alpha3.VirtualMachineNetworkConfigDHCPOptionsStatus, s conversion.Scope) error { + out.Enabled = in.Enabled + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkConfigDHCPOptionsStatus_To_v1alpha3_VirtualMachineNetworkConfigDHCPOptionsStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkConfigDHCPOptionsStatus_To_v1alpha3_VirtualMachineNetworkConfigDHCPOptionsStatus(in *VirtualMachineNetworkConfigDHCPOptionsStatus, out *v1alpha3.VirtualMachineNetworkConfigDHCPOptionsStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkConfigDHCPOptionsStatus_To_v1alpha3_VirtualMachineNetworkConfigDHCPOptionsStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkConfigDHCPOptionsStatus_To_v1alpha2_VirtualMachineNetworkConfigDHCPOptionsStatus(in *v1alpha3.VirtualMachineNetworkConfigDHCPOptionsStatus, out *VirtualMachineNetworkConfigDHCPOptionsStatus, s conversion.Scope) error { + out.Enabled = in.Enabled + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkConfigDHCPOptionsStatus_To_v1alpha2_VirtualMachineNetworkConfigDHCPOptionsStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkConfigDHCPOptionsStatus_To_v1alpha2_VirtualMachineNetworkConfigDHCPOptionsStatus(in *v1alpha3.VirtualMachineNetworkConfigDHCPOptionsStatus, out *VirtualMachineNetworkConfigDHCPOptionsStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkConfigDHCPOptionsStatus_To_v1alpha2_VirtualMachineNetworkConfigDHCPOptionsStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkConfigDHCPStatus_To_v1alpha3_VirtualMachineNetworkConfigDHCPStatus(in *VirtualMachineNetworkConfigDHCPStatus, out *v1alpha3.VirtualMachineNetworkConfigDHCPStatus, s conversion.Scope) error { + out.IP4 = (*v1alpha3.VirtualMachineNetworkConfigDHCPOptionsStatus)(unsafe.Pointer(in.IP4)) + out.IP6 = (*v1alpha3.VirtualMachineNetworkConfigDHCPOptionsStatus)(unsafe.Pointer(in.IP6)) + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkConfigDHCPStatus_To_v1alpha3_VirtualMachineNetworkConfigDHCPStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkConfigDHCPStatus_To_v1alpha3_VirtualMachineNetworkConfigDHCPStatus(in *VirtualMachineNetworkConfigDHCPStatus, out *v1alpha3.VirtualMachineNetworkConfigDHCPStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkConfigDHCPStatus_To_v1alpha3_VirtualMachineNetworkConfigDHCPStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkConfigDHCPStatus_To_v1alpha2_VirtualMachineNetworkConfigDHCPStatus(in *v1alpha3.VirtualMachineNetworkConfigDHCPStatus, out *VirtualMachineNetworkConfigDHCPStatus, s conversion.Scope) error { + out.IP4 = (*VirtualMachineNetworkConfigDHCPOptionsStatus)(unsafe.Pointer(in.IP4)) + out.IP6 = (*VirtualMachineNetworkConfigDHCPOptionsStatus)(unsafe.Pointer(in.IP6)) + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkConfigDHCPStatus_To_v1alpha2_VirtualMachineNetworkConfigDHCPStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkConfigDHCPStatus_To_v1alpha2_VirtualMachineNetworkConfigDHCPStatus(in *v1alpha3.VirtualMachineNetworkConfigDHCPStatus, out *VirtualMachineNetworkConfigDHCPStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkConfigDHCPStatus_To_v1alpha2_VirtualMachineNetworkConfigDHCPStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkConfigDNSStatus_To_v1alpha3_VirtualMachineNetworkConfigDNSStatus(in *VirtualMachineNetworkConfigDNSStatus, out *v1alpha3.VirtualMachineNetworkConfigDNSStatus, s conversion.Scope) error { + out.HostName = in.HostName + out.Nameservers = *(*[]string)(unsafe.Pointer(&in.Nameservers)) + out.SearchDomains = *(*[]string)(unsafe.Pointer(&in.SearchDomains)) + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkConfigDNSStatus_To_v1alpha3_VirtualMachineNetworkConfigDNSStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkConfigDNSStatus_To_v1alpha3_VirtualMachineNetworkConfigDNSStatus(in *VirtualMachineNetworkConfigDNSStatus, out *v1alpha3.VirtualMachineNetworkConfigDNSStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkConfigDNSStatus_To_v1alpha3_VirtualMachineNetworkConfigDNSStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkConfigDNSStatus_To_v1alpha2_VirtualMachineNetworkConfigDNSStatus(in *v1alpha3.VirtualMachineNetworkConfigDNSStatus, out *VirtualMachineNetworkConfigDNSStatus, s conversion.Scope) error { + out.HostName = in.HostName + out.Nameservers = *(*[]string)(unsafe.Pointer(&in.Nameservers)) + out.SearchDomains = *(*[]string)(unsafe.Pointer(&in.SearchDomains)) + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkConfigDNSStatus_To_v1alpha2_VirtualMachineNetworkConfigDNSStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkConfigDNSStatus_To_v1alpha2_VirtualMachineNetworkConfigDNSStatus(in *v1alpha3.VirtualMachineNetworkConfigDNSStatus, out *VirtualMachineNetworkConfigDNSStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkConfigDNSStatus_To_v1alpha2_VirtualMachineNetworkConfigDNSStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkConfigInterfaceIPStatus_To_v1alpha3_VirtualMachineNetworkConfigInterfaceIPStatus(in *VirtualMachineNetworkConfigInterfaceIPStatus, out *v1alpha3.VirtualMachineNetworkConfigInterfaceIPStatus, s conversion.Scope) error { + out.DHCP = (*v1alpha3.VirtualMachineNetworkConfigDHCPStatus)(unsafe.Pointer(in.DHCP)) + out.Addresses = *(*[]string)(unsafe.Pointer(&in.Addresses)) + out.Gateway4 = in.Gateway4 + out.Gateway6 = in.Gateway6 + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkConfigInterfaceIPStatus_To_v1alpha3_VirtualMachineNetworkConfigInterfaceIPStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkConfigInterfaceIPStatus_To_v1alpha3_VirtualMachineNetworkConfigInterfaceIPStatus(in *VirtualMachineNetworkConfigInterfaceIPStatus, out *v1alpha3.VirtualMachineNetworkConfigInterfaceIPStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkConfigInterfaceIPStatus_To_v1alpha3_VirtualMachineNetworkConfigInterfaceIPStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkConfigInterfaceIPStatus_To_v1alpha2_VirtualMachineNetworkConfigInterfaceIPStatus(in *v1alpha3.VirtualMachineNetworkConfigInterfaceIPStatus, out *VirtualMachineNetworkConfigInterfaceIPStatus, s conversion.Scope) error { + out.DHCP = (*VirtualMachineNetworkConfigDHCPStatus)(unsafe.Pointer(in.DHCP)) + out.Addresses = *(*[]string)(unsafe.Pointer(&in.Addresses)) + out.Gateway4 = in.Gateway4 + out.Gateway6 = in.Gateway6 + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkConfigInterfaceIPStatus_To_v1alpha2_VirtualMachineNetworkConfigInterfaceIPStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkConfigInterfaceIPStatus_To_v1alpha2_VirtualMachineNetworkConfigInterfaceIPStatus(in *v1alpha3.VirtualMachineNetworkConfigInterfaceIPStatus, out *VirtualMachineNetworkConfigInterfaceIPStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkConfigInterfaceIPStatus_To_v1alpha2_VirtualMachineNetworkConfigInterfaceIPStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkConfigInterfaceStatus_To_v1alpha3_VirtualMachineNetworkConfigInterfaceStatus(in *VirtualMachineNetworkConfigInterfaceStatus, out *v1alpha3.VirtualMachineNetworkConfigInterfaceStatus, s conversion.Scope) error { + out.Name = in.Name + out.IP = (*v1alpha3.VirtualMachineNetworkConfigInterfaceIPStatus)(unsafe.Pointer(in.IP)) + out.DNS = (*v1alpha3.VirtualMachineNetworkConfigDNSStatus)(unsafe.Pointer(in.DNS)) + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkConfigInterfaceStatus_To_v1alpha3_VirtualMachineNetworkConfigInterfaceStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkConfigInterfaceStatus_To_v1alpha3_VirtualMachineNetworkConfigInterfaceStatus(in *VirtualMachineNetworkConfigInterfaceStatus, out *v1alpha3.VirtualMachineNetworkConfigInterfaceStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkConfigInterfaceStatus_To_v1alpha3_VirtualMachineNetworkConfigInterfaceStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkConfigInterfaceStatus_To_v1alpha2_VirtualMachineNetworkConfigInterfaceStatus(in *v1alpha3.VirtualMachineNetworkConfigInterfaceStatus, out *VirtualMachineNetworkConfigInterfaceStatus, s conversion.Scope) error { + out.Name = in.Name + out.IP = (*VirtualMachineNetworkConfigInterfaceIPStatus)(unsafe.Pointer(in.IP)) + out.DNS = (*VirtualMachineNetworkConfigDNSStatus)(unsafe.Pointer(in.DNS)) + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkConfigInterfaceStatus_To_v1alpha2_VirtualMachineNetworkConfigInterfaceStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkConfigInterfaceStatus_To_v1alpha2_VirtualMachineNetworkConfigInterfaceStatus(in *v1alpha3.VirtualMachineNetworkConfigInterfaceStatus, out *VirtualMachineNetworkConfigInterfaceStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkConfigInterfaceStatus_To_v1alpha2_VirtualMachineNetworkConfigInterfaceStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkConfigStatus_To_v1alpha3_VirtualMachineNetworkConfigStatus(in *VirtualMachineNetworkConfigStatus, out *v1alpha3.VirtualMachineNetworkConfigStatus, s conversion.Scope) error { + out.Interfaces = *(*[]v1alpha3.VirtualMachineNetworkConfigInterfaceStatus)(unsafe.Pointer(&in.Interfaces)) + out.DNS = (*v1alpha3.VirtualMachineNetworkConfigDNSStatus)(unsafe.Pointer(in.DNS)) + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkConfigStatus_To_v1alpha3_VirtualMachineNetworkConfigStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkConfigStatus_To_v1alpha3_VirtualMachineNetworkConfigStatus(in *VirtualMachineNetworkConfigStatus, out *v1alpha3.VirtualMachineNetworkConfigStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkConfigStatus_To_v1alpha3_VirtualMachineNetworkConfigStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkConfigStatus_To_v1alpha2_VirtualMachineNetworkConfigStatus(in *v1alpha3.VirtualMachineNetworkConfigStatus, out *VirtualMachineNetworkConfigStatus, s conversion.Scope) error { + out.Interfaces = *(*[]VirtualMachineNetworkConfigInterfaceStatus)(unsafe.Pointer(&in.Interfaces)) + out.DNS = (*VirtualMachineNetworkConfigDNSStatus)(unsafe.Pointer(in.DNS)) + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkConfigStatus_To_v1alpha2_VirtualMachineNetworkConfigStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkConfigStatus_To_v1alpha2_VirtualMachineNetworkConfigStatus(in *v1alpha3.VirtualMachineNetworkConfigStatus, out *VirtualMachineNetworkConfigStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkConfigStatus_To_v1alpha2_VirtualMachineNetworkConfigStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkDHCPOptionsStatus_To_v1alpha3_VirtualMachineNetworkDHCPOptionsStatus(in *VirtualMachineNetworkDHCPOptionsStatus, out *v1alpha3.VirtualMachineNetworkDHCPOptionsStatus, s conversion.Scope) error { + out.Config = *(*[]common.KeyValuePair)(unsafe.Pointer(&in.Config)) + out.Enabled = in.Enabled + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkDHCPOptionsStatus_To_v1alpha3_VirtualMachineNetworkDHCPOptionsStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkDHCPOptionsStatus_To_v1alpha3_VirtualMachineNetworkDHCPOptionsStatus(in *VirtualMachineNetworkDHCPOptionsStatus, out *v1alpha3.VirtualMachineNetworkDHCPOptionsStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkDHCPOptionsStatus_To_v1alpha3_VirtualMachineNetworkDHCPOptionsStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkDHCPOptionsStatus_To_v1alpha2_VirtualMachineNetworkDHCPOptionsStatus(in *v1alpha3.VirtualMachineNetworkDHCPOptionsStatus, out *VirtualMachineNetworkDHCPOptionsStatus, s conversion.Scope) error { + out.Config = *(*[]v1alpha2common.KeyValuePair)(unsafe.Pointer(&in.Config)) + out.Enabled = in.Enabled + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkDHCPOptionsStatus_To_v1alpha2_VirtualMachineNetworkDHCPOptionsStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkDHCPOptionsStatus_To_v1alpha2_VirtualMachineNetworkDHCPOptionsStatus(in *v1alpha3.VirtualMachineNetworkDHCPOptionsStatus, out *VirtualMachineNetworkDHCPOptionsStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkDHCPOptionsStatus_To_v1alpha2_VirtualMachineNetworkDHCPOptionsStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkDHCPStatus_To_v1alpha3_VirtualMachineNetworkDHCPStatus(in *VirtualMachineNetworkDHCPStatus, out *v1alpha3.VirtualMachineNetworkDHCPStatus, s conversion.Scope) error { + if err := Convert_v1alpha2_VirtualMachineNetworkDHCPOptionsStatus_To_v1alpha3_VirtualMachineNetworkDHCPOptionsStatus(&in.IP4, &out.IP4, s); err != nil { + return err + } + if err := Convert_v1alpha2_VirtualMachineNetworkDHCPOptionsStatus_To_v1alpha3_VirtualMachineNetworkDHCPOptionsStatus(&in.IP6, &out.IP6, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkDHCPStatus_To_v1alpha3_VirtualMachineNetworkDHCPStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkDHCPStatus_To_v1alpha3_VirtualMachineNetworkDHCPStatus(in *VirtualMachineNetworkDHCPStatus, out *v1alpha3.VirtualMachineNetworkDHCPStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkDHCPStatus_To_v1alpha3_VirtualMachineNetworkDHCPStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkDHCPStatus_To_v1alpha2_VirtualMachineNetworkDHCPStatus(in *v1alpha3.VirtualMachineNetworkDHCPStatus, out *VirtualMachineNetworkDHCPStatus, s conversion.Scope) error { + if err := Convert_v1alpha3_VirtualMachineNetworkDHCPOptionsStatus_To_v1alpha2_VirtualMachineNetworkDHCPOptionsStatus(&in.IP4, &out.IP4, s); err != nil { + return err + } + if err := Convert_v1alpha3_VirtualMachineNetworkDHCPOptionsStatus_To_v1alpha2_VirtualMachineNetworkDHCPOptionsStatus(&in.IP6, &out.IP6, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkDHCPStatus_To_v1alpha2_VirtualMachineNetworkDHCPStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkDHCPStatus_To_v1alpha2_VirtualMachineNetworkDHCPStatus(in *v1alpha3.VirtualMachineNetworkDHCPStatus, out *VirtualMachineNetworkDHCPStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkDHCPStatus_To_v1alpha2_VirtualMachineNetworkDHCPStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkDNSStatus_To_v1alpha3_VirtualMachineNetworkDNSStatus(in *VirtualMachineNetworkDNSStatus, out *v1alpha3.VirtualMachineNetworkDNSStatus, s conversion.Scope) error { + out.DHCP = in.DHCP + out.DomainName = in.DomainName + out.HostName = in.HostName + out.Nameservers = *(*[]string)(unsafe.Pointer(&in.Nameservers)) + out.SearchDomains = *(*[]string)(unsafe.Pointer(&in.SearchDomains)) + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkDNSStatus_To_v1alpha3_VirtualMachineNetworkDNSStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkDNSStatus_To_v1alpha3_VirtualMachineNetworkDNSStatus(in *VirtualMachineNetworkDNSStatus, out *v1alpha3.VirtualMachineNetworkDNSStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkDNSStatus_To_v1alpha3_VirtualMachineNetworkDNSStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkDNSStatus_To_v1alpha2_VirtualMachineNetworkDNSStatus(in *v1alpha3.VirtualMachineNetworkDNSStatus, out *VirtualMachineNetworkDNSStatus, s conversion.Scope) error { + out.DHCP = in.DHCP + out.DomainName = in.DomainName + out.HostName = in.HostName + out.Nameservers = *(*[]string)(unsafe.Pointer(&in.Nameservers)) + out.SearchDomains = *(*[]string)(unsafe.Pointer(&in.SearchDomains)) + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkDNSStatus_To_v1alpha2_VirtualMachineNetworkDNSStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkDNSStatus_To_v1alpha2_VirtualMachineNetworkDNSStatus(in *v1alpha3.VirtualMachineNetworkDNSStatus, out *VirtualMachineNetworkDNSStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkDNSStatus_To_v1alpha2_VirtualMachineNetworkDNSStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkIPRouteGatewayStatus_To_v1alpha3_VirtualMachineNetworkIPRouteGatewayStatus(in *VirtualMachineNetworkIPRouteGatewayStatus, out *v1alpha3.VirtualMachineNetworkIPRouteGatewayStatus, s conversion.Scope) error { + out.Device = in.Device + out.Address = in.Address + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkIPRouteGatewayStatus_To_v1alpha3_VirtualMachineNetworkIPRouteGatewayStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkIPRouteGatewayStatus_To_v1alpha3_VirtualMachineNetworkIPRouteGatewayStatus(in *VirtualMachineNetworkIPRouteGatewayStatus, out *v1alpha3.VirtualMachineNetworkIPRouteGatewayStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkIPRouteGatewayStatus_To_v1alpha3_VirtualMachineNetworkIPRouteGatewayStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkIPRouteGatewayStatus_To_v1alpha2_VirtualMachineNetworkIPRouteGatewayStatus(in *v1alpha3.VirtualMachineNetworkIPRouteGatewayStatus, out *VirtualMachineNetworkIPRouteGatewayStatus, s conversion.Scope) error { + out.Device = in.Device + out.Address = in.Address + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkIPRouteGatewayStatus_To_v1alpha2_VirtualMachineNetworkIPRouteGatewayStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkIPRouteGatewayStatus_To_v1alpha2_VirtualMachineNetworkIPRouteGatewayStatus(in *v1alpha3.VirtualMachineNetworkIPRouteGatewayStatus, out *VirtualMachineNetworkIPRouteGatewayStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkIPRouteGatewayStatus_To_v1alpha2_VirtualMachineNetworkIPRouteGatewayStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkIPRouteStatus_To_v1alpha3_VirtualMachineNetworkIPRouteStatus(in *VirtualMachineNetworkIPRouteStatus, out *v1alpha3.VirtualMachineNetworkIPRouteStatus, s conversion.Scope) error { + if err := Convert_v1alpha2_VirtualMachineNetworkIPRouteGatewayStatus_To_v1alpha3_VirtualMachineNetworkIPRouteGatewayStatus(&in.Gateway, &out.Gateway, s); err != nil { + return err + } + out.NetworkAddress = in.NetworkAddress + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkIPRouteStatus_To_v1alpha3_VirtualMachineNetworkIPRouteStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkIPRouteStatus_To_v1alpha3_VirtualMachineNetworkIPRouteStatus(in *VirtualMachineNetworkIPRouteStatus, out *v1alpha3.VirtualMachineNetworkIPRouteStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkIPRouteStatus_To_v1alpha3_VirtualMachineNetworkIPRouteStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkIPRouteStatus_To_v1alpha2_VirtualMachineNetworkIPRouteStatus(in *v1alpha3.VirtualMachineNetworkIPRouteStatus, out *VirtualMachineNetworkIPRouteStatus, s conversion.Scope) error { + if err := Convert_v1alpha3_VirtualMachineNetworkIPRouteGatewayStatus_To_v1alpha2_VirtualMachineNetworkIPRouteGatewayStatus(&in.Gateway, &out.Gateway, s); err != nil { + return err + } + out.NetworkAddress = in.NetworkAddress + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkIPRouteStatus_To_v1alpha2_VirtualMachineNetworkIPRouteStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkIPRouteStatus_To_v1alpha2_VirtualMachineNetworkIPRouteStatus(in *v1alpha3.VirtualMachineNetworkIPRouteStatus, out *VirtualMachineNetworkIPRouteStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkIPRouteStatus_To_v1alpha2_VirtualMachineNetworkIPRouteStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkIPStackStatus_To_v1alpha3_VirtualMachineNetworkIPStackStatus(in *VirtualMachineNetworkIPStackStatus, out *v1alpha3.VirtualMachineNetworkIPStackStatus, s conversion.Scope) error { + out.DHCP = (*v1alpha3.VirtualMachineNetworkDHCPStatus)(unsafe.Pointer(in.DHCP)) + out.DNS = (*v1alpha3.VirtualMachineNetworkDNSStatus)(unsafe.Pointer(in.DNS)) + out.IPRoutes = *(*[]v1alpha3.VirtualMachineNetworkIPRouteStatus)(unsafe.Pointer(&in.IPRoutes)) + out.KernelConfig = *(*[]common.KeyValuePair)(unsafe.Pointer(&in.KernelConfig)) + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkIPStackStatus_To_v1alpha3_VirtualMachineNetworkIPStackStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkIPStackStatus_To_v1alpha3_VirtualMachineNetworkIPStackStatus(in *VirtualMachineNetworkIPStackStatus, out *v1alpha3.VirtualMachineNetworkIPStackStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkIPStackStatus_To_v1alpha3_VirtualMachineNetworkIPStackStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkIPStackStatus_To_v1alpha2_VirtualMachineNetworkIPStackStatus(in *v1alpha3.VirtualMachineNetworkIPStackStatus, out *VirtualMachineNetworkIPStackStatus, s conversion.Scope) error { + out.DHCP = (*VirtualMachineNetworkDHCPStatus)(unsafe.Pointer(in.DHCP)) + out.DNS = (*VirtualMachineNetworkDNSStatus)(unsafe.Pointer(in.DNS)) + out.IPRoutes = *(*[]VirtualMachineNetworkIPRouteStatus)(unsafe.Pointer(&in.IPRoutes)) + out.KernelConfig = *(*[]v1alpha2common.KeyValuePair)(unsafe.Pointer(&in.KernelConfig)) + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkIPStackStatus_To_v1alpha2_VirtualMachineNetworkIPStackStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkIPStackStatus_To_v1alpha2_VirtualMachineNetworkIPStackStatus(in *v1alpha3.VirtualMachineNetworkIPStackStatus, out *VirtualMachineNetworkIPStackStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkIPStackStatus_To_v1alpha2_VirtualMachineNetworkIPStackStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkInterfaceIPAddrStatus_To_v1alpha3_VirtualMachineNetworkInterfaceIPAddrStatus(in *VirtualMachineNetworkInterfaceIPAddrStatus, out *v1alpha3.VirtualMachineNetworkInterfaceIPAddrStatus, s conversion.Scope) error { + out.Address = in.Address + out.Lifetime = in.Lifetime + out.Origin = in.Origin + out.State = in.State + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkInterfaceIPAddrStatus_To_v1alpha3_VirtualMachineNetworkInterfaceIPAddrStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkInterfaceIPAddrStatus_To_v1alpha3_VirtualMachineNetworkInterfaceIPAddrStatus(in *VirtualMachineNetworkInterfaceIPAddrStatus, out *v1alpha3.VirtualMachineNetworkInterfaceIPAddrStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkInterfaceIPAddrStatus_To_v1alpha3_VirtualMachineNetworkInterfaceIPAddrStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkInterfaceIPAddrStatus_To_v1alpha2_VirtualMachineNetworkInterfaceIPAddrStatus(in *v1alpha3.VirtualMachineNetworkInterfaceIPAddrStatus, out *VirtualMachineNetworkInterfaceIPAddrStatus, s conversion.Scope) error { + out.Address = in.Address + out.Lifetime = in.Lifetime + out.Origin = in.Origin + out.State = in.State + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkInterfaceIPAddrStatus_To_v1alpha2_VirtualMachineNetworkInterfaceIPAddrStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkInterfaceIPAddrStatus_To_v1alpha2_VirtualMachineNetworkInterfaceIPAddrStatus(in *v1alpha3.VirtualMachineNetworkInterfaceIPAddrStatus, out *VirtualMachineNetworkInterfaceIPAddrStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkInterfaceIPAddrStatus_To_v1alpha2_VirtualMachineNetworkInterfaceIPAddrStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkInterfaceIPStatus_To_v1alpha3_VirtualMachineNetworkInterfaceIPStatus(in *VirtualMachineNetworkInterfaceIPStatus, out *v1alpha3.VirtualMachineNetworkInterfaceIPStatus, s conversion.Scope) error { + out.AutoConfigurationEnabled = (*bool)(unsafe.Pointer(in.AutoConfigurationEnabled)) + out.DHCP = (*v1alpha3.VirtualMachineNetworkDHCPStatus)(unsafe.Pointer(in.DHCP)) + out.Addresses = *(*[]v1alpha3.VirtualMachineNetworkInterfaceIPAddrStatus)(unsafe.Pointer(&in.Addresses)) + out.MACAddr = in.MACAddr + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkInterfaceIPStatus_To_v1alpha3_VirtualMachineNetworkInterfaceIPStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkInterfaceIPStatus_To_v1alpha3_VirtualMachineNetworkInterfaceIPStatus(in *VirtualMachineNetworkInterfaceIPStatus, out *v1alpha3.VirtualMachineNetworkInterfaceIPStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkInterfaceIPStatus_To_v1alpha3_VirtualMachineNetworkInterfaceIPStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkInterfaceIPStatus_To_v1alpha2_VirtualMachineNetworkInterfaceIPStatus(in *v1alpha3.VirtualMachineNetworkInterfaceIPStatus, out *VirtualMachineNetworkInterfaceIPStatus, s conversion.Scope) error { + out.AutoConfigurationEnabled = (*bool)(unsafe.Pointer(in.AutoConfigurationEnabled)) + out.DHCP = (*VirtualMachineNetworkDHCPStatus)(unsafe.Pointer(in.DHCP)) + out.Addresses = *(*[]VirtualMachineNetworkInterfaceIPAddrStatus)(unsafe.Pointer(&in.Addresses)) + out.MACAddr = in.MACAddr + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkInterfaceIPStatus_To_v1alpha2_VirtualMachineNetworkInterfaceIPStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkInterfaceIPStatus_To_v1alpha2_VirtualMachineNetworkInterfaceIPStatus(in *v1alpha3.VirtualMachineNetworkInterfaceIPStatus, out *VirtualMachineNetworkInterfaceIPStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkInterfaceIPStatus_To_v1alpha2_VirtualMachineNetworkInterfaceIPStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkInterfaceSpec_To_v1alpha3_VirtualMachineNetworkInterfaceSpec(in *VirtualMachineNetworkInterfaceSpec, out *v1alpha3.VirtualMachineNetworkInterfaceSpec, s conversion.Scope) error { + out.Name = in.Name + out.Network = (*common.PartialObjectRef)(unsafe.Pointer(in.Network)) + out.GuestDeviceName = in.GuestDeviceName + out.Addresses = *(*[]string)(unsafe.Pointer(&in.Addresses)) + out.DHCP4 = in.DHCP4 + out.DHCP6 = in.DHCP6 + out.Gateway4 = in.Gateway4 + out.Gateway6 = in.Gateway6 + out.MTU = (*int64)(unsafe.Pointer(in.MTU)) + out.Nameservers = *(*[]string)(unsafe.Pointer(&in.Nameservers)) + out.Routes = *(*[]v1alpha3.VirtualMachineNetworkRouteSpec)(unsafe.Pointer(&in.Routes)) + out.SearchDomains = *(*[]string)(unsafe.Pointer(&in.SearchDomains)) + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkInterfaceSpec_To_v1alpha3_VirtualMachineNetworkInterfaceSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkInterfaceSpec_To_v1alpha3_VirtualMachineNetworkInterfaceSpec(in *VirtualMachineNetworkInterfaceSpec, out *v1alpha3.VirtualMachineNetworkInterfaceSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkInterfaceSpec_To_v1alpha3_VirtualMachineNetworkInterfaceSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkInterfaceSpec_To_v1alpha2_VirtualMachineNetworkInterfaceSpec(in *v1alpha3.VirtualMachineNetworkInterfaceSpec, out *VirtualMachineNetworkInterfaceSpec, s conversion.Scope) error { + out.Name = in.Name + out.Network = (*v1alpha2common.PartialObjectRef)(unsafe.Pointer(in.Network)) + out.GuestDeviceName = in.GuestDeviceName + out.Addresses = *(*[]string)(unsafe.Pointer(&in.Addresses)) + out.DHCP4 = in.DHCP4 + out.DHCP6 = in.DHCP6 + out.Gateway4 = in.Gateway4 + out.Gateway6 = in.Gateway6 + out.MTU = (*int64)(unsafe.Pointer(in.MTU)) + out.Nameservers = *(*[]string)(unsafe.Pointer(&in.Nameservers)) + out.Routes = *(*[]VirtualMachineNetworkRouteSpec)(unsafe.Pointer(&in.Routes)) + out.SearchDomains = *(*[]string)(unsafe.Pointer(&in.SearchDomains)) + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkInterfaceSpec_To_v1alpha2_VirtualMachineNetworkInterfaceSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkInterfaceSpec_To_v1alpha2_VirtualMachineNetworkInterfaceSpec(in *v1alpha3.VirtualMachineNetworkInterfaceSpec, out *VirtualMachineNetworkInterfaceSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkInterfaceSpec_To_v1alpha2_VirtualMachineNetworkInterfaceSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkInterfaceStatus_To_v1alpha3_VirtualMachineNetworkInterfaceStatus(in *VirtualMachineNetworkInterfaceStatus, out *v1alpha3.VirtualMachineNetworkInterfaceStatus, s conversion.Scope) error { + out.Name = in.Name + out.DeviceKey = in.DeviceKey + out.IP = (*v1alpha3.VirtualMachineNetworkInterfaceIPStatus)(unsafe.Pointer(in.IP)) + out.DNS = (*v1alpha3.VirtualMachineNetworkDNSStatus)(unsafe.Pointer(in.DNS)) + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkInterfaceStatus_To_v1alpha3_VirtualMachineNetworkInterfaceStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkInterfaceStatus_To_v1alpha3_VirtualMachineNetworkInterfaceStatus(in *VirtualMachineNetworkInterfaceStatus, out *v1alpha3.VirtualMachineNetworkInterfaceStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkInterfaceStatus_To_v1alpha3_VirtualMachineNetworkInterfaceStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkInterfaceStatus_To_v1alpha2_VirtualMachineNetworkInterfaceStatus(in *v1alpha3.VirtualMachineNetworkInterfaceStatus, out *VirtualMachineNetworkInterfaceStatus, s conversion.Scope) error { + out.Name = in.Name + out.DeviceKey = in.DeviceKey + out.IP = (*VirtualMachineNetworkInterfaceIPStatus)(unsafe.Pointer(in.IP)) + out.DNS = (*VirtualMachineNetworkDNSStatus)(unsafe.Pointer(in.DNS)) + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkInterfaceStatus_To_v1alpha2_VirtualMachineNetworkInterfaceStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkInterfaceStatus_To_v1alpha2_VirtualMachineNetworkInterfaceStatus(in *v1alpha3.VirtualMachineNetworkInterfaceStatus, out *VirtualMachineNetworkInterfaceStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkInterfaceStatus_To_v1alpha2_VirtualMachineNetworkInterfaceStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkRouteSpec_To_v1alpha3_VirtualMachineNetworkRouteSpec(in *VirtualMachineNetworkRouteSpec, out *v1alpha3.VirtualMachineNetworkRouteSpec, s conversion.Scope) error { + out.To = in.To + out.Via = in.Via + out.Metric = in.Metric + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkRouteSpec_To_v1alpha3_VirtualMachineNetworkRouteSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkRouteSpec_To_v1alpha3_VirtualMachineNetworkRouteSpec(in *VirtualMachineNetworkRouteSpec, out *v1alpha3.VirtualMachineNetworkRouteSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkRouteSpec_To_v1alpha3_VirtualMachineNetworkRouteSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkRouteSpec_To_v1alpha2_VirtualMachineNetworkRouteSpec(in *v1alpha3.VirtualMachineNetworkRouteSpec, out *VirtualMachineNetworkRouteSpec, s conversion.Scope) error { + out.To = in.To + out.Via = in.Via + out.Metric = in.Metric + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkRouteSpec_To_v1alpha2_VirtualMachineNetworkRouteSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkRouteSpec_To_v1alpha2_VirtualMachineNetworkRouteSpec(in *v1alpha3.VirtualMachineNetworkRouteSpec, out *VirtualMachineNetworkRouteSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkRouteSpec_To_v1alpha2_VirtualMachineNetworkRouteSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkRouteStatus_To_v1alpha3_VirtualMachineNetworkRouteStatus(in *VirtualMachineNetworkRouteStatus, out *v1alpha3.VirtualMachineNetworkRouteStatus, s conversion.Scope) error { + out.IPRoutes = *(*[]v1alpha3.VirtualMachineNetworkIPRouteStatus)(unsafe.Pointer(&in.IPRoutes)) + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkRouteStatus_To_v1alpha3_VirtualMachineNetworkRouteStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkRouteStatus_To_v1alpha3_VirtualMachineNetworkRouteStatus(in *VirtualMachineNetworkRouteStatus, out *v1alpha3.VirtualMachineNetworkRouteStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkRouteStatus_To_v1alpha3_VirtualMachineNetworkRouteStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkRouteStatus_To_v1alpha2_VirtualMachineNetworkRouteStatus(in *v1alpha3.VirtualMachineNetworkRouteStatus, out *VirtualMachineNetworkRouteStatus, s conversion.Scope) error { + out.IPRoutes = *(*[]VirtualMachineNetworkIPRouteStatus)(unsafe.Pointer(&in.IPRoutes)) + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkRouteStatus_To_v1alpha2_VirtualMachineNetworkRouteStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkRouteStatus_To_v1alpha2_VirtualMachineNetworkRouteStatus(in *v1alpha3.VirtualMachineNetworkRouteStatus, out *VirtualMachineNetworkRouteStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkRouteStatus_To_v1alpha2_VirtualMachineNetworkRouteStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkSpec_To_v1alpha3_VirtualMachineNetworkSpec(in *VirtualMachineNetworkSpec, out *v1alpha3.VirtualMachineNetworkSpec, s conversion.Scope) error { + out.HostName = in.HostName + out.Disabled = in.Disabled + out.Nameservers = *(*[]string)(unsafe.Pointer(&in.Nameservers)) + out.SearchDomains = *(*[]string)(unsafe.Pointer(&in.SearchDomains)) + out.Interfaces = *(*[]v1alpha3.VirtualMachineNetworkInterfaceSpec)(unsafe.Pointer(&in.Interfaces)) + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkSpec_To_v1alpha3_VirtualMachineNetworkSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkSpec_To_v1alpha3_VirtualMachineNetworkSpec(in *VirtualMachineNetworkSpec, out *v1alpha3.VirtualMachineNetworkSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkSpec_To_v1alpha3_VirtualMachineNetworkSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkSpec_To_v1alpha2_VirtualMachineNetworkSpec(in *v1alpha3.VirtualMachineNetworkSpec, out *VirtualMachineNetworkSpec, s conversion.Scope) error { + out.HostName = in.HostName + out.Disabled = in.Disabled + out.Nameservers = *(*[]string)(unsafe.Pointer(&in.Nameservers)) + out.SearchDomains = *(*[]string)(unsafe.Pointer(&in.SearchDomains)) + out.Interfaces = *(*[]VirtualMachineNetworkInterfaceSpec)(unsafe.Pointer(&in.Interfaces)) + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkSpec_To_v1alpha2_VirtualMachineNetworkSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkSpec_To_v1alpha2_VirtualMachineNetworkSpec(in *v1alpha3.VirtualMachineNetworkSpec, out *VirtualMachineNetworkSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkSpec_To_v1alpha2_VirtualMachineNetworkSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineNetworkStatus_To_v1alpha3_VirtualMachineNetworkStatus(in *VirtualMachineNetworkStatus, out *v1alpha3.VirtualMachineNetworkStatus, s conversion.Scope) error { + out.Config = (*v1alpha3.VirtualMachineNetworkConfigStatus)(unsafe.Pointer(in.Config)) + out.Interfaces = *(*[]v1alpha3.VirtualMachineNetworkInterfaceStatus)(unsafe.Pointer(&in.Interfaces)) + out.IPStacks = *(*[]v1alpha3.VirtualMachineNetworkIPStackStatus)(unsafe.Pointer(&in.IPStacks)) + out.PrimaryIP4 = in.PrimaryIP4 + out.PrimaryIP6 = in.PrimaryIP6 + return nil +} + +// Convert_v1alpha2_VirtualMachineNetworkStatus_To_v1alpha3_VirtualMachineNetworkStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineNetworkStatus_To_v1alpha3_VirtualMachineNetworkStatus(in *VirtualMachineNetworkStatus, out *v1alpha3.VirtualMachineNetworkStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineNetworkStatus_To_v1alpha3_VirtualMachineNetworkStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineNetworkStatus_To_v1alpha2_VirtualMachineNetworkStatus(in *v1alpha3.VirtualMachineNetworkStatus, out *VirtualMachineNetworkStatus, s conversion.Scope) error { + out.Config = (*VirtualMachineNetworkConfigStatus)(unsafe.Pointer(in.Config)) + out.Interfaces = *(*[]VirtualMachineNetworkInterfaceStatus)(unsafe.Pointer(&in.Interfaces)) + out.IPStacks = *(*[]VirtualMachineNetworkIPStackStatus)(unsafe.Pointer(&in.IPStacks)) + out.PrimaryIP4 = in.PrimaryIP4 + out.PrimaryIP6 = in.PrimaryIP6 + return nil +} + +// Convert_v1alpha3_VirtualMachineNetworkStatus_To_v1alpha2_VirtualMachineNetworkStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineNetworkStatus_To_v1alpha2_VirtualMachineNetworkStatus(in *v1alpha3.VirtualMachineNetworkStatus, out *VirtualMachineNetworkStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineNetworkStatus_To_v1alpha2_VirtualMachineNetworkStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachinePublishRequest_To_v1alpha3_VirtualMachinePublishRequest(in *VirtualMachinePublishRequest, out *v1alpha3.VirtualMachinePublishRequest, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha2_VirtualMachinePublishRequestSpec_To_v1alpha3_VirtualMachinePublishRequestSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha2_VirtualMachinePublishRequestStatus_To_v1alpha3_VirtualMachinePublishRequestStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_VirtualMachinePublishRequest_To_v1alpha3_VirtualMachinePublishRequest is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachinePublishRequest_To_v1alpha3_VirtualMachinePublishRequest(in *VirtualMachinePublishRequest, out *v1alpha3.VirtualMachinePublishRequest, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachinePublishRequest_To_v1alpha3_VirtualMachinePublishRequest(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachinePublishRequest_To_v1alpha2_VirtualMachinePublishRequest(in *v1alpha3.VirtualMachinePublishRequest, out *VirtualMachinePublishRequest, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_VirtualMachinePublishRequestSpec_To_v1alpha2_VirtualMachinePublishRequestSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha3_VirtualMachinePublishRequestStatus_To_v1alpha2_VirtualMachinePublishRequestStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_VirtualMachinePublishRequest_To_v1alpha2_VirtualMachinePublishRequest is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequest_To_v1alpha2_VirtualMachinePublishRequest(in *v1alpha3.VirtualMachinePublishRequest, out *VirtualMachinePublishRequest, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequest_To_v1alpha2_VirtualMachinePublishRequest(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachinePublishRequestList_To_v1alpha3_VirtualMachinePublishRequestList(in *VirtualMachinePublishRequestList, out *v1alpha3.VirtualMachinePublishRequestList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha3.VirtualMachinePublishRequest)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha2_VirtualMachinePublishRequestList_To_v1alpha3_VirtualMachinePublishRequestList is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachinePublishRequestList_To_v1alpha3_VirtualMachinePublishRequestList(in *VirtualMachinePublishRequestList, out *v1alpha3.VirtualMachinePublishRequestList, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachinePublishRequestList_To_v1alpha3_VirtualMachinePublishRequestList(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachinePublishRequestList_To_v1alpha2_VirtualMachinePublishRequestList(in *v1alpha3.VirtualMachinePublishRequestList, out *VirtualMachinePublishRequestList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]VirtualMachinePublishRequest)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha3_VirtualMachinePublishRequestList_To_v1alpha2_VirtualMachinePublishRequestList is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequestList_To_v1alpha2_VirtualMachinePublishRequestList(in *v1alpha3.VirtualMachinePublishRequestList, out *VirtualMachinePublishRequestList, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequestList_To_v1alpha2_VirtualMachinePublishRequestList(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachinePublishRequestSource_To_v1alpha3_VirtualMachinePublishRequestSource(in *VirtualMachinePublishRequestSource, out *v1alpha3.VirtualMachinePublishRequestSource, s conversion.Scope) error { + out.Name = in.Name + out.APIVersion = in.APIVersion + out.Kind = in.Kind + return nil +} + +// Convert_v1alpha2_VirtualMachinePublishRequestSource_To_v1alpha3_VirtualMachinePublishRequestSource is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachinePublishRequestSource_To_v1alpha3_VirtualMachinePublishRequestSource(in *VirtualMachinePublishRequestSource, out *v1alpha3.VirtualMachinePublishRequestSource, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachinePublishRequestSource_To_v1alpha3_VirtualMachinePublishRequestSource(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachinePublishRequestSource_To_v1alpha2_VirtualMachinePublishRequestSource(in *v1alpha3.VirtualMachinePublishRequestSource, out *VirtualMachinePublishRequestSource, s conversion.Scope) error { + out.Name = in.Name + out.APIVersion = in.APIVersion + out.Kind = in.Kind + return nil +} + +// Convert_v1alpha3_VirtualMachinePublishRequestSource_To_v1alpha2_VirtualMachinePublishRequestSource is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequestSource_To_v1alpha2_VirtualMachinePublishRequestSource(in *v1alpha3.VirtualMachinePublishRequestSource, out *VirtualMachinePublishRequestSource, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequestSource_To_v1alpha2_VirtualMachinePublishRequestSource(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachinePublishRequestSpec_To_v1alpha3_VirtualMachinePublishRequestSpec(in *VirtualMachinePublishRequestSpec, out *v1alpha3.VirtualMachinePublishRequestSpec, s conversion.Scope) error { + if err := Convert_v1alpha2_VirtualMachinePublishRequestSource_To_v1alpha3_VirtualMachinePublishRequestSource(&in.Source, &out.Source, s); err != nil { + return err + } + if err := Convert_v1alpha2_VirtualMachinePublishRequestTarget_To_v1alpha3_VirtualMachinePublishRequestTarget(&in.Target, &out.Target, s); err != nil { + return err + } + out.TTLSecondsAfterFinished = (*int64)(unsafe.Pointer(in.TTLSecondsAfterFinished)) + return nil +} + +// Convert_v1alpha2_VirtualMachinePublishRequestSpec_To_v1alpha3_VirtualMachinePublishRequestSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachinePublishRequestSpec_To_v1alpha3_VirtualMachinePublishRequestSpec(in *VirtualMachinePublishRequestSpec, out *v1alpha3.VirtualMachinePublishRequestSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachinePublishRequestSpec_To_v1alpha3_VirtualMachinePublishRequestSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachinePublishRequestSpec_To_v1alpha2_VirtualMachinePublishRequestSpec(in *v1alpha3.VirtualMachinePublishRequestSpec, out *VirtualMachinePublishRequestSpec, s conversion.Scope) error { + if err := Convert_v1alpha3_VirtualMachinePublishRequestSource_To_v1alpha2_VirtualMachinePublishRequestSource(&in.Source, &out.Source, s); err != nil { + return err + } + if err := Convert_v1alpha3_VirtualMachinePublishRequestTarget_To_v1alpha2_VirtualMachinePublishRequestTarget(&in.Target, &out.Target, s); err != nil { + return err + } + out.TTLSecondsAfterFinished = (*int64)(unsafe.Pointer(in.TTLSecondsAfterFinished)) + return nil +} + +// Convert_v1alpha3_VirtualMachinePublishRequestSpec_To_v1alpha2_VirtualMachinePublishRequestSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequestSpec_To_v1alpha2_VirtualMachinePublishRequestSpec(in *v1alpha3.VirtualMachinePublishRequestSpec, out *VirtualMachinePublishRequestSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequestSpec_To_v1alpha2_VirtualMachinePublishRequestSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachinePublishRequestStatus_To_v1alpha3_VirtualMachinePublishRequestStatus(in *VirtualMachinePublishRequestStatus, out *v1alpha3.VirtualMachinePublishRequestStatus, s conversion.Scope) error { + out.SourceRef = (*v1alpha3.VirtualMachinePublishRequestSource)(unsafe.Pointer(in.SourceRef)) + out.TargetRef = (*v1alpha3.VirtualMachinePublishRequestTarget)(unsafe.Pointer(in.TargetRef)) + out.CompletionTime = in.CompletionTime + out.StartTime = in.StartTime + out.Attempts = in.Attempts + out.LastAttemptTime = in.LastAttemptTime + out.ImageName = in.ImageName + out.Ready = in.Ready + out.Conditions = *(*[]v1.Condition)(unsafe.Pointer(&in.Conditions)) + return nil +} + +// Convert_v1alpha2_VirtualMachinePublishRequestStatus_To_v1alpha3_VirtualMachinePublishRequestStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachinePublishRequestStatus_To_v1alpha3_VirtualMachinePublishRequestStatus(in *VirtualMachinePublishRequestStatus, out *v1alpha3.VirtualMachinePublishRequestStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachinePublishRequestStatus_To_v1alpha3_VirtualMachinePublishRequestStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachinePublishRequestStatus_To_v1alpha2_VirtualMachinePublishRequestStatus(in *v1alpha3.VirtualMachinePublishRequestStatus, out *VirtualMachinePublishRequestStatus, s conversion.Scope) error { + out.SourceRef = (*VirtualMachinePublishRequestSource)(unsafe.Pointer(in.SourceRef)) + out.TargetRef = (*VirtualMachinePublishRequestTarget)(unsafe.Pointer(in.TargetRef)) + out.CompletionTime = in.CompletionTime + out.StartTime = in.StartTime + out.Attempts = in.Attempts + out.LastAttemptTime = in.LastAttemptTime + out.ImageName = in.ImageName + out.Ready = in.Ready + out.Conditions = *(*[]v1.Condition)(unsafe.Pointer(&in.Conditions)) + return nil +} + +// Convert_v1alpha3_VirtualMachinePublishRequestStatus_To_v1alpha2_VirtualMachinePublishRequestStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequestStatus_To_v1alpha2_VirtualMachinePublishRequestStatus(in *v1alpha3.VirtualMachinePublishRequestStatus, out *VirtualMachinePublishRequestStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequestStatus_To_v1alpha2_VirtualMachinePublishRequestStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachinePublishRequestTarget_To_v1alpha3_VirtualMachinePublishRequestTarget(in *VirtualMachinePublishRequestTarget, out *v1alpha3.VirtualMachinePublishRequestTarget, s conversion.Scope) error { + if err := Convert_v1alpha2_VirtualMachinePublishRequestTargetItem_To_v1alpha3_VirtualMachinePublishRequestTargetItem(&in.Item, &out.Item, s); err != nil { + return err + } + if err := Convert_v1alpha2_VirtualMachinePublishRequestTargetLocation_To_v1alpha3_VirtualMachinePublishRequestTargetLocation(&in.Location, &out.Location, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_VirtualMachinePublishRequestTarget_To_v1alpha3_VirtualMachinePublishRequestTarget is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachinePublishRequestTarget_To_v1alpha3_VirtualMachinePublishRequestTarget(in *VirtualMachinePublishRequestTarget, out *v1alpha3.VirtualMachinePublishRequestTarget, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachinePublishRequestTarget_To_v1alpha3_VirtualMachinePublishRequestTarget(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachinePublishRequestTarget_To_v1alpha2_VirtualMachinePublishRequestTarget(in *v1alpha3.VirtualMachinePublishRequestTarget, out *VirtualMachinePublishRequestTarget, s conversion.Scope) error { + if err := Convert_v1alpha3_VirtualMachinePublishRequestTargetItem_To_v1alpha2_VirtualMachinePublishRequestTargetItem(&in.Item, &out.Item, s); err != nil { + return err + } + if err := Convert_v1alpha3_VirtualMachinePublishRequestTargetLocation_To_v1alpha2_VirtualMachinePublishRequestTargetLocation(&in.Location, &out.Location, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_VirtualMachinePublishRequestTarget_To_v1alpha2_VirtualMachinePublishRequestTarget is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequestTarget_To_v1alpha2_VirtualMachinePublishRequestTarget(in *v1alpha3.VirtualMachinePublishRequestTarget, out *VirtualMachinePublishRequestTarget, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequestTarget_To_v1alpha2_VirtualMachinePublishRequestTarget(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachinePublishRequestTargetItem_To_v1alpha3_VirtualMachinePublishRequestTargetItem(in *VirtualMachinePublishRequestTargetItem, out *v1alpha3.VirtualMachinePublishRequestTargetItem, s conversion.Scope) error { + out.Name = in.Name + out.Description = in.Description + return nil +} + +// Convert_v1alpha2_VirtualMachinePublishRequestTargetItem_To_v1alpha3_VirtualMachinePublishRequestTargetItem is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachinePublishRequestTargetItem_To_v1alpha3_VirtualMachinePublishRequestTargetItem(in *VirtualMachinePublishRequestTargetItem, out *v1alpha3.VirtualMachinePublishRequestTargetItem, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachinePublishRequestTargetItem_To_v1alpha3_VirtualMachinePublishRequestTargetItem(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachinePublishRequestTargetItem_To_v1alpha2_VirtualMachinePublishRequestTargetItem(in *v1alpha3.VirtualMachinePublishRequestTargetItem, out *VirtualMachinePublishRequestTargetItem, s conversion.Scope) error { + out.Name = in.Name + out.Description = in.Description + return nil +} + +// Convert_v1alpha3_VirtualMachinePublishRequestTargetItem_To_v1alpha2_VirtualMachinePublishRequestTargetItem is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequestTargetItem_To_v1alpha2_VirtualMachinePublishRequestTargetItem(in *v1alpha3.VirtualMachinePublishRequestTargetItem, out *VirtualMachinePublishRequestTargetItem, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequestTargetItem_To_v1alpha2_VirtualMachinePublishRequestTargetItem(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachinePublishRequestTargetLocation_To_v1alpha3_VirtualMachinePublishRequestTargetLocation(in *VirtualMachinePublishRequestTargetLocation, out *v1alpha3.VirtualMachinePublishRequestTargetLocation, s conversion.Scope) error { + out.Name = in.Name + out.APIVersion = in.APIVersion + out.Kind = in.Kind + return nil +} + +// Convert_v1alpha2_VirtualMachinePublishRequestTargetLocation_To_v1alpha3_VirtualMachinePublishRequestTargetLocation is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachinePublishRequestTargetLocation_To_v1alpha3_VirtualMachinePublishRequestTargetLocation(in *VirtualMachinePublishRequestTargetLocation, out *v1alpha3.VirtualMachinePublishRequestTargetLocation, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachinePublishRequestTargetLocation_To_v1alpha3_VirtualMachinePublishRequestTargetLocation(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachinePublishRequestTargetLocation_To_v1alpha2_VirtualMachinePublishRequestTargetLocation(in *v1alpha3.VirtualMachinePublishRequestTargetLocation, out *VirtualMachinePublishRequestTargetLocation, s conversion.Scope) error { + out.Name = in.Name + out.APIVersion = in.APIVersion + out.Kind = in.Kind + return nil +} + +// Convert_v1alpha3_VirtualMachinePublishRequestTargetLocation_To_v1alpha2_VirtualMachinePublishRequestTargetLocation is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachinePublishRequestTargetLocation_To_v1alpha2_VirtualMachinePublishRequestTargetLocation(in *v1alpha3.VirtualMachinePublishRequestTargetLocation, out *VirtualMachinePublishRequestTargetLocation, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachinePublishRequestTargetLocation_To_v1alpha2_VirtualMachinePublishRequestTargetLocation(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineReadinessProbeSpec_To_v1alpha3_VirtualMachineReadinessProbeSpec(in *VirtualMachineReadinessProbeSpec, out *v1alpha3.VirtualMachineReadinessProbeSpec, s conversion.Scope) error { + out.TCPSocket = (*v1alpha3.TCPSocketAction)(unsafe.Pointer(in.TCPSocket)) + out.GuestHeartbeat = (*v1alpha3.GuestHeartbeatAction)(unsafe.Pointer(in.GuestHeartbeat)) + out.GuestInfo = *(*[]v1alpha3.GuestInfoAction)(unsafe.Pointer(&in.GuestInfo)) + out.TimeoutSeconds = in.TimeoutSeconds + out.PeriodSeconds = in.PeriodSeconds + return nil +} + +// Convert_v1alpha2_VirtualMachineReadinessProbeSpec_To_v1alpha3_VirtualMachineReadinessProbeSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineReadinessProbeSpec_To_v1alpha3_VirtualMachineReadinessProbeSpec(in *VirtualMachineReadinessProbeSpec, out *v1alpha3.VirtualMachineReadinessProbeSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineReadinessProbeSpec_To_v1alpha3_VirtualMachineReadinessProbeSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineReadinessProbeSpec_To_v1alpha2_VirtualMachineReadinessProbeSpec(in *v1alpha3.VirtualMachineReadinessProbeSpec, out *VirtualMachineReadinessProbeSpec, s conversion.Scope) error { + out.TCPSocket = (*TCPSocketAction)(unsafe.Pointer(in.TCPSocket)) + out.GuestHeartbeat = (*GuestHeartbeatAction)(unsafe.Pointer(in.GuestHeartbeat)) + out.GuestInfo = *(*[]GuestInfoAction)(unsafe.Pointer(&in.GuestInfo)) + out.TimeoutSeconds = in.TimeoutSeconds + out.PeriodSeconds = in.PeriodSeconds + return nil +} + +// Convert_v1alpha3_VirtualMachineReadinessProbeSpec_To_v1alpha2_VirtualMachineReadinessProbeSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineReadinessProbeSpec_To_v1alpha2_VirtualMachineReadinessProbeSpec(in *v1alpha3.VirtualMachineReadinessProbeSpec, out *VirtualMachineReadinessProbeSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineReadinessProbeSpec_To_v1alpha2_VirtualMachineReadinessProbeSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineReservedSpec_To_v1alpha3_VirtualMachineReservedSpec(in *VirtualMachineReservedSpec, out *v1alpha3.VirtualMachineReservedSpec, s conversion.Scope) error { + out.ResourcePolicyName = in.ResourcePolicyName + return nil +} + +// Convert_v1alpha2_VirtualMachineReservedSpec_To_v1alpha3_VirtualMachineReservedSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineReservedSpec_To_v1alpha3_VirtualMachineReservedSpec(in *VirtualMachineReservedSpec, out *v1alpha3.VirtualMachineReservedSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineReservedSpec_To_v1alpha3_VirtualMachineReservedSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineReservedSpec_To_v1alpha2_VirtualMachineReservedSpec(in *v1alpha3.VirtualMachineReservedSpec, out *VirtualMachineReservedSpec, s conversion.Scope) error { + out.ResourcePolicyName = in.ResourcePolicyName + return nil +} + +// Convert_v1alpha3_VirtualMachineReservedSpec_To_v1alpha2_VirtualMachineReservedSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineReservedSpec_To_v1alpha2_VirtualMachineReservedSpec(in *v1alpha3.VirtualMachineReservedSpec, out *VirtualMachineReservedSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineReservedSpec_To_v1alpha2_VirtualMachineReservedSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(in *VirtualMachineResourceSpec, out *v1alpha3.VirtualMachineResourceSpec, s conversion.Scope) error { + out.Cpu = in.Cpu + out.Memory = in.Memory + return nil +} + +// Convert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(in *VirtualMachineResourceSpec, out *v1alpha3.VirtualMachineResourceSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineResourceSpec_To_v1alpha3_VirtualMachineResourceSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(in *v1alpha3.VirtualMachineResourceSpec, out *VirtualMachineResourceSpec, s conversion.Scope) error { + out.Cpu = in.Cpu + out.Memory = in.Memory + return nil +} + +// Convert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(in *v1alpha3.VirtualMachineResourceSpec, out *VirtualMachineResourceSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineResourceSpec_To_v1alpha2_VirtualMachineResourceSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineService_To_v1alpha3_VirtualMachineService(in *VirtualMachineService, out *v1alpha3.VirtualMachineService, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha2_VirtualMachineServiceSpec_To_v1alpha3_VirtualMachineServiceSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha2_VirtualMachineServiceStatus_To_v1alpha3_VirtualMachineServiceStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_VirtualMachineService_To_v1alpha3_VirtualMachineService is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineService_To_v1alpha3_VirtualMachineService(in *VirtualMachineService, out *v1alpha3.VirtualMachineService, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineService_To_v1alpha3_VirtualMachineService(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineService_To_v1alpha2_VirtualMachineService(in *v1alpha3.VirtualMachineService, out *VirtualMachineService, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_VirtualMachineServiceSpec_To_v1alpha2_VirtualMachineServiceSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha3_VirtualMachineServiceStatus_To_v1alpha2_VirtualMachineServiceStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_VirtualMachineService_To_v1alpha2_VirtualMachineService is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineService_To_v1alpha2_VirtualMachineService(in *v1alpha3.VirtualMachineService, out *VirtualMachineService, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineService_To_v1alpha2_VirtualMachineService(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineServiceList_To_v1alpha3_VirtualMachineServiceList(in *VirtualMachineServiceList, out *v1alpha3.VirtualMachineServiceList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha3.VirtualMachineService)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha2_VirtualMachineServiceList_To_v1alpha3_VirtualMachineServiceList is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineServiceList_To_v1alpha3_VirtualMachineServiceList(in *VirtualMachineServiceList, out *v1alpha3.VirtualMachineServiceList, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineServiceList_To_v1alpha3_VirtualMachineServiceList(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineServiceList_To_v1alpha2_VirtualMachineServiceList(in *v1alpha3.VirtualMachineServiceList, out *VirtualMachineServiceList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]VirtualMachineService)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha3_VirtualMachineServiceList_To_v1alpha2_VirtualMachineServiceList is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineServiceList_To_v1alpha2_VirtualMachineServiceList(in *v1alpha3.VirtualMachineServiceList, out *VirtualMachineServiceList, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineServiceList_To_v1alpha2_VirtualMachineServiceList(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineServicePort_To_v1alpha3_VirtualMachineServicePort(in *VirtualMachineServicePort, out *v1alpha3.VirtualMachineServicePort, s conversion.Scope) error { + out.Name = in.Name + out.Protocol = in.Protocol + out.Port = in.Port + out.TargetPort = in.TargetPort + return nil +} + +// Convert_v1alpha2_VirtualMachineServicePort_To_v1alpha3_VirtualMachineServicePort is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineServicePort_To_v1alpha3_VirtualMachineServicePort(in *VirtualMachineServicePort, out *v1alpha3.VirtualMachineServicePort, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineServicePort_To_v1alpha3_VirtualMachineServicePort(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineServicePort_To_v1alpha2_VirtualMachineServicePort(in *v1alpha3.VirtualMachineServicePort, out *VirtualMachineServicePort, s conversion.Scope) error { + out.Name = in.Name + out.Protocol = in.Protocol + out.Port = in.Port + out.TargetPort = in.TargetPort + return nil +} + +// Convert_v1alpha3_VirtualMachineServicePort_To_v1alpha2_VirtualMachineServicePort is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineServicePort_To_v1alpha2_VirtualMachineServicePort(in *v1alpha3.VirtualMachineServicePort, out *VirtualMachineServicePort, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineServicePort_To_v1alpha2_VirtualMachineServicePort(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineServiceSpec_To_v1alpha3_VirtualMachineServiceSpec(in *VirtualMachineServiceSpec, out *v1alpha3.VirtualMachineServiceSpec, s conversion.Scope) error { + out.Type = v1alpha3.VirtualMachineServiceType(in.Type) + out.Ports = *(*[]v1alpha3.VirtualMachineServicePort)(unsafe.Pointer(&in.Ports)) + out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) + out.LoadBalancerIP = in.LoadBalancerIP + out.LoadBalancerSourceRanges = *(*[]string)(unsafe.Pointer(&in.LoadBalancerSourceRanges)) + out.ClusterIP = in.ClusterIP + out.ExternalName = in.ExternalName + return nil +} + +// Convert_v1alpha2_VirtualMachineServiceSpec_To_v1alpha3_VirtualMachineServiceSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineServiceSpec_To_v1alpha3_VirtualMachineServiceSpec(in *VirtualMachineServiceSpec, out *v1alpha3.VirtualMachineServiceSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineServiceSpec_To_v1alpha3_VirtualMachineServiceSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineServiceSpec_To_v1alpha2_VirtualMachineServiceSpec(in *v1alpha3.VirtualMachineServiceSpec, out *VirtualMachineServiceSpec, s conversion.Scope) error { + out.Type = VirtualMachineServiceType(in.Type) + out.Ports = *(*[]VirtualMachineServicePort)(unsafe.Pointer(&in.Ports)) + out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) + out.LoadBalancerIP = in.LoadBalancerIP + out.LoadBalancerSourceRanges = *(*[]string)(unsafe.Pointer(&in.LoadBalancerSourceRanges)) + out.ClusterIP = in.ClusterIP + out.ExternalName = in.ExternalName + return nil +} + +// Convert_v1alpha3_VirtualMachineServiceSpec_To_v1alpha2_VirtualMachineServiceSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineServiceSpec_To_v1alpha2_VirtualMachineServiceSpec(in *v1alpha3.VirtualMachineServiceSpec, out *VirtualMachineServiceSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineServiceSpec_To_v1alpha2_VirtualMachineServiceSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineServiceStatus_To_v1alpha3_VirtualMachineServiceStatus(in *VirtualMachineServiceStatus, out *v1alpha3.VirtualMachineServiceStatus, s conversion.Scope) error { + if err := Convert_v1alpha2_LoadBalancerStatus_To_v1alpha3_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_VirtualMachineServiceStatus_To_v1alpha3_VirtualMachineServiceStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineServiceStatus_To_v1alpha3_VirtualMachineServiceStatus(in *VirtualMachineServiceStatus, out *v1alpha3.VirtualMachineServiceStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineServiceStatus_To_v1alpha3_VirtualMachineServiceStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineServiceStatus_To_v1alpha2_VirtualMachineServiceStatus(in *v1alpha3.VirtualMachineServiceStatus, out *VirtualMachineServiceStatus, s conversion.Scope) error { + if err := Convert_v1alpha3_LoadBalancerStatus_To_v1alpha2_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_VirtualMachineServiceStatus_To_v1alpha2_VirtualMachineServiceStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineServiceStatus_To_v1alpha2_VirtualMachineServiceStatus(in *v1alpha3.VirtualMachineServiceStatus, out *VirtualMachineServiceStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineServiceStatus_To_v1alpha2_VirtualMachineServiceStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineSetResourcePolicy_To_v1alpha3_VirtualMachineSetResourcePolicy(in *VirtualMachineSetResourcePolicy, out *v1alpha3.VirtualMachineSetResourcePolicy, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha2_VirtualMachineSetResourcePolicySpec_To_v1alpha3_VirtualMachineSetResourcePolicySpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha2_VirtualMachineSetResourcePolicyStatus_To_v1alpha3_VirtualMachineSetResourcePolicyStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_VirtualMachineSetResourcePolicy_To_v1alpha3_VirtualMachineSetResourcePolicy is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineSetResourcePolicy_To_v1alpha3_VirtualMachineSetResourcePolicy(in *VirtualMachineSetResourcePolicy, out *v1alpha3.VirtualMachineSetResourcePolicy, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineSetResourcePolicy_To_v1alpha3_VirtualMachineSetResourcePolicy(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineSetResourcePolicy_To_v1alpha2_VirtualMachineSetResourcePolicy(in *v1alpha3.VirtualMachineSetResourcePolicy, out *VirtualMachineSetResourcePolicy, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_VirtualMachineSetResourcePolicySpec_To_v1alpha2_VirtualMachineSetResourcePolicySpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha3_VirtualMachineSetResourcePolicyStatus_To_v1alpha2_VirtualMachineSetResourcePolicyStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_VirtualMachineSetResourcePolicy_To_v1alpha2_VirtualMachineSetResourcePolicy is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineSetResourcePolicy_To_v1alpha2_VirtualMachineSetResourcePolicy(in *v1alpha3.VirtualMachineSetResourcePolicy, out *VirtualMachineSetResourcePolicy, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineSetResourcePolicy_To_v1alpha2_VirtualMachineSetResourcePolicy(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineSetResourcePolicyList_To_v1alpha3_VirtualMachineSetResourcePolicyList(in *VirtualMachineSetResourcePolicyList, out *v1alpha3.VirtualMachineSetResourcePolicyList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha3.VirtualMachineSetResourcePolicy)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha2_VirtualMachineSetResourcePolicyList_To_v1alpha3_VirtualMachineSetResourcePolicyList is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineSetResourcePolicyList_To_v1alpha3_VirtualMachineSetResourcePolicyList(in *VirtualMachineSetResourcePolicyList, out *v1alpha3.VirtualMachineSetResourcePolicyList, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineSetResourcePolicyList_To_v1alpha3_VirtualMachineSetResourcePolicyList(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineSetResourcePolicyList_To_v1alpha2_VirtualMachineSetResourcePolicyList(in *v1alpha3.VirtualMachineSetResourcePolicyList, out *VirtualMachineSetResourcePolicyList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]VirtualMachineSetResourcePolicy)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha3_VirtualMachineSetResourcePolicyList_To_v1alpha2_VirtualMachineSetResourcePolicyList is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineSetResourcePolicyList_To_v1alpha2_VirtualMachineSetResourcePolicyList(in *v1alpha3.VirtualMachineSetResourcePolicyList, out *VirtualMachineSetResourcePolicyList, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineSetResourcePolicyList_To_v1alpha2_VirtualMachineSetResourcePolicyList(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineSetResourcePolicySpec_To_v1alpha3_VirtualMachineSetResourcePolicySpec(in *VirtualMachineSetResourcePolicySpec, out *v1alpha3.VirtualMachineSetResourcePolicySpec, s conversion.Scope) error { + if err := Convert_v1alpha2_ResourcePoolSpec_To_v1alpha3_ResourcePoolSpec(&in.ResourcePool, &out.ResourcePool, s); err != nil { + return err + } + out.Folder = in.Folder + out.ClusterModuleGroups = *(*[]string)(unsafe.Pointer(&in.ClusterModuleGroups)) + return nil +} + +// Convert_v1alpha2_VirtualMachineSetResourcePolicySpec_To_v1alpha3_VirtualMachineSetResourcePolicySpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineSetResourcePolicySpec_To_v1alpha3_VirtualMachineSetResourcePolicySpec(in *VirtualMachineSetResourcePolicySpec, out *v1alpha3.VirtualMachineSetResourcePolicySpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineSetResourcePolicySpec_To_v1alpha3_VirtualMachineSetResourcePolicySpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineSetResourcePolicySpec_To_v1alpha2_VirtualMachineSetResourcePolicySpec(in *v1alpha3.VirtualMachineSetResourcePolicySpec, out *VirtualMachineSetResourcePolicySpec, s conversion.Scope) error { + if err := Convert_v1alpha3_ResourcePoolSpec_To_v1alpha2_ResourcePoolSpec(&in.ResourcePool, &out.ResourcePool, s); err != nil { + return err + } + out.Folder = in.Folder + out.ClusterModuleGroups = *(*[]string)(unsafe.Pointer(&in.ClusterModuleGroups)) + return nil +} + +// Convert_v1alpha3_VirtualMachineSetResourcePolicySpec_To_v1alpha2_VirtualMachineSetResourcePolicySpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineSetResourcePolicySpec_To_v1alpha2_VirtualMachineSetResourcePolicySpec(in *v1alpha3.VirtualMachineSetResourcePolicySpec, out *VirtualMachineSetResourcePolicySpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineSetResourcePolicySpec_To_v1alpha2_VirtualMachineSetResourcePolicySpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineSetResourcePolicyStatus_To_v1alpha3_VirtualMachineSetResourcePolicyStatus(in *VirtualMachineSetResourcePolicyStatus, out *v1alpha3.VirtualMachineSetResourcePolicyStatus, s conversion.Scope) error { + out.ClusterModules = *(*[]v1alpha3.VSphereClusterModuleStatus)(unsafe.Pointer(&in.ClusterModules)) + return nil +} + +// Convert_v1alpha2_VirtualMachineSetResourcePolicyStatus_To_v1alpha3_VirtualMachineSetResourcePolicyStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineSetResourcePolicyStatus_To_v1alpha3_VirtualMachineSetResourcePolicyStatus(in *VirtualMachineSetResourcePolicyStatus, out *v1alpha3.VirtualMachineSetResourcePolicyStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineSetResourcePolicyStatus_To_v1alpha3_VirtualMachineSetResourcePolicyStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineSetResourcePolicyStatus_To_v1alpha2_VirtualMachineSetResourcePolicyStatus(in *v1alpha3.VirtualMachineSetResourcePolicyStatus, out *VirtualMachineSetResourcePolicyStatus, s conversion.Scope) error { + out.ClusterModules = *(*[]VSphereClusterModuleStatus)(unsafe.Pointer(&in.ClusterModules)) + return nil +} + +// Convert_v1alpha3_VirtualMachineSetResourcePolicyStatus_To_v1alpha2_VirtualMachineSetResourcePolicyStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineSetResourcePolicyStatus_To_v1alpha2_VirtualMachineSetResourcePolicyStatus(in *v1alpha3.VirtualMachineSetResourcePolicyStatus, out *VirtualMachineSetResourcePolicyStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineSetResourcePolicyStatus_To_v1alpha2_VirtualMachineSetResourcePolicyStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineSpec_To_v1alpha3_VirtualMachineSpec(in *VirtualMachineSpec, out *v1alpha3.VirtualMachineSpec, s conversion.Scope) error { + out.ImageName = in.ImageName + out.ClassName = in.ClassName + out.StorageClass = in.StorageClass + out.Bootstrap = (*v1alpha3.VirtualMachineBootstrapSpec)(unsafe.Pointer(in.Bootstrap)) + out.Network = (*v1alpha3.VirtualMachineNetworkSpec)(unsafe.Pointer(in.Network)) + out.PowerState = v1alpha3.VirtualMachinePowerState(in.PowerState) + out.PowerOffMode = v1alpha3.VirtualMachinePowerOpMode(in.PowerOffMode) + out.SuspendMode = v1alpha3.VirtualMachinePowerOpMode(in.SuspendMode) + out.NextRestartTime = in.NextRestartTime + out.RestartMode = v1alpha3.VirtualMachinePowerOpMode(in.RestartMode) + out.Volumes = *(*[]v1alpha3.VirtualMachineVolume)(unsafe.Pointer(&in.Volumes)) + out.ReadinessProbe = (*v1alpha3.VirtualMachineReadinessProbeSpec)(unsafe.Pointer(in.ReadinessProbe)) + out.Advanced = (*v1alpha3.VirtualMachineAdvancedSpec)(unsafe.Pointer(in.Advanced)) + out.Reserved = (*v1alpha3.VirtualMachineReservedSpec)(unsafe.Pointer(in.Reserved)) + out.MinHardwareVersion = in.MinHardwareVersion + return nil +} + +// Convert_v1alpha2_VirtualMachineSpec_To_v1alpha3_VirtualMachineSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineSpec_To_v1alpha3_VirtualMachineSpec(in *VirtualMachineSpec, out *v1alpha3.VirtualMachineSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineSpec_To_v1alpha3_VirtualMachineSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec(in *v1alpha3.VirtualMachineSpec, out *VirtualMachineSpec, s conversion.Scope) error { + out.ImageName = in.ImageName + out.ClassName = in.ClassName + out.StorageClass = in.StorageClass + out.Bootstrap = (*VirtualMachineBootstrapSpec)(unsafe.Pointer(in.Bootstrap)) + out.Network = (*VirtualMachineNetworkSpec)(unsafe.Pointer(in.Network)) + out.PowerState = VirtualMachinePowerState(in.PowerState) + out.PowerOffMode = VirtualMachinePowerOpMode(in.PowerOffMode) + out.SuspendMode = VirtualMachinePowerOpMode(in.SuspendMode) + out.NextRestartTime = in.NextRestartTime + out.RestartMode = VirtualMachinePowerOpMode(in.RestartMode) + out.Volumes = *(*[]VirtualMachineVolume)(unsafe.Pointer(&in.Volumes)) + out.ReadinessProbe = (*VirtualMachineReadinessProbeSpec)(unsafe.Pointer(in.ReadinessProbe)) + out.Advanced = (*VirtualMachineAdvancedSpec)(unsafe.Pointer(in.Advanced)) + out.Reserved = (*VirtualMachineReservedSpec)(unsafe.Pointer(in.Reserved)) + out.MinHardwareVersion = in.MinHardwareVersion + return nil +} + +// Convert_v1alpha3_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec(in *v1alpha3.VirtualMachineSpec, out *VirtualMachineSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineSpec_To_v1alpha2_VirtualMachineSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineStatus_To_v1alpha3_VirtualMachineStatus(in *VirtualMachineStatus, out *v1alpha3.VirtualMachineStatus, s conversion.Scope) error { + out.Image = (*common.LocalObjectRef)(unsafe.Pointer(in.Image)) + out.Class = (*common.LocalObjectRef)(unsafe.Pointer(in.Class)) + out.Host = in.Host + out.PowerState = v1alpha3.VirtualMachinePowerState(in.PowerState) + out.Conditions = *(*[]v1.Condition)(unsafe.Pointer(&in.Conditions)) + out.Network = (*v1alpha3.VirtualMachineNetworkStatus)(unsafe.Pointer(in.Network)) + out.UniqueID = in.UniqueID + out.BiosUUID = in.BiosUUID + out.InstanceUUID = in.InstanceUUID + out.Volumes = *(*[]v1alpha3.VirtualMachineVolumeStatus)(unsafe.Pointer(&in.Volumes)) + out.ChangeBlockTracking = (*bool)(unsafe.Pointer(in.ChangeBlockTracking)) + out.Zone = in.Zone + out.LastRestartTime = (*v1.Time)(unsafe.Pointer(in.LastRestartTime)) + out.HardwareVersion = in.HardwareVersion + return nil +} + +// Convert_v1alpha2_VirtualMachineStatus_To_v1alpha3_VirtualMachineStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineStatus_To_v1alpha3_VirtualMachineStatus(in *VirtualMachineStatus, out *v1alpha3.VirtualMachineStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineStatus_To_v1alpha3_VirtualMachineStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineStatus_To_v1alpha2_VirtualMachineStatus(in *v1alpha3.VirtualMachineStatus, out *VirtualMachineStatus, s conversion.Scope) error { + out.Image = (*v1alpha2common.LocalObjectRef)(unsafe.Pointer(in.Image)) + out.Class = (*v1alpha2common.LocalObjectRef)(unsafe.Pointer(in.Class)) + out.Host = in.Host + out.PowerState = VirtualMachinePowerState(in.PowerState) + out.Conditions = *(*[]v1.Condition)(unsafe.Pointer(&in.Conditions)) + out.Network = (*VirtualMachineNetworkStatus)(unsafe.Pointer(in.Network)) + out.UniqueID = in.UniqueID + out.BiosUUID = in.BiosUUID + out.InstanceUUID = in.InstanceUUID + out.Volumes = *(*[]VirtualMachineVolumeStatus)(unsafe.Pointer(&in.Volumes)) + out.ChangeBlockTracking = (*bool)(unsafe.Pointer(in.ChangeBlockTracking)) + out.Zone = in.Zone + out.LastRestartTime = (*v1.Time)(unsafe.Pointer(in.LastRestartTime)) + out.HardwareVersion = in.HardwareVersion + return nil +} + +// Convert_v1alpha3_VirtualMachineStatus_To_v1alpha2_VirtualMachineStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineStatus_To_v1alpha2_VirtualMachineStatus(in *v1alpha3.VirtualMachineStatus, out *VirtualMachineStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineStatus_To_v1alpha2_VirtualMachineStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineTemplate_To_v1alpha3_VirtualMachineTemplate(in *VirtualMachineTemplate, out *v1alpha3.VirtualMachineTemplate, s conversion.Scope) error { + if err := Convert_v1alpha2_NetworkStatus_To_v1alpha3_NetworkStatus(&in.Net, &out.Net, s); err != nil { + return err + } + out.VM = (*v1alpha3.VirtualMachine)(unsafe.Pointer(in.VM)) + return nil +} + +// Convert_v1alpha2_VirtualMachineTemplate_To_v1alpha3_VirtualMachineTemplate is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineTemplate_To_v1alpha3_VirtualMachineTemplate(in *VirtualMachineTemplate, out *v1alpha3.VirtualMachineTemplate, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineTemplate_To_v1alpha3_VirtualMachineTemplate(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineTemplate_To_v1alpha2_VirtualMachineTemplate(in *v1alpha3.VirtualMachineTemplate, out *VirtualMachineTemplate, s conversion.Scope) error { + if err := Convert_v1alpha3_NetworkStatus_To_v1alpha2_NetworkStatus(&in.Net, &out.Net, s); err != nil { + return err + } + out.VM = (*VirtualMachine)(unsafe.Pointer(in.VM)) + return nil +} + +// Convert_v1alpha3_VirtualMachineTemplate_To_v1alpha2_VirtualMachineTemplate is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineTemplate_To_v1alpha2_VirtualMachineTemplate(in *v1alpha3.VirtualMachineTemplate, out *VirtualMachineTemplate, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineTemplate_To_v1alpha2_VirtualMachineTemplate(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineVolume_To_v1alpha3_VirtualMachineVolume(in *VirtualMachineVolume, out *v1alpha3.VirtualMachineVolume, s conversion.Scope) error { + out.Name = in.Name + if err := Convert_v1alpha2_VirtualMachineVolumeSource_To_v1alpha3_VirtualMachineVolumeSource(&in.VirtualMachineVolumeSource, &out.VirtualMachineVolumeSource, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_VirtualMachineVolume_To_v1alpha3_VirtualMachineVolume is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineVolume_To_v1alpha3_VirtualMachineVolume(in *VirtualMachineVolume, out *v1alpha3.VirtualMachineVolume, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineVolume_To_v1alpha3_VirtualMachineVolume(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineVolume_To_v1alpha2_VirtualMachineVolume(in *v1alpha3.VirtualMachineVolume, out *VirtualMachineVolume, s conversion.Scope) error { + out.Name = in.Name + if err := Convert_v1alpha3_VirtualMachineVolumeSource_To_v1alpha2_VirtualMachineVolumeSource(&in.VirtualMachineVolumeSource, &out.VirtualMachineVolumeSource, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_VirtualMachineVolume_To_v1alpha2_VirtualMachineVolume is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineVolume_To_v1alpha2_VirtualMachineVolume(in *v1alpha3.VirtualMachineVolume, out *VirtualMachineVolume, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineVolume_To_v1alpha2_VirtualMachineVolume(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineVolumeSource_To_v1alpha3_VirtualMachineVolumeSource(in *VirtualMachineVolumeSource, out *v1alpha3.VirtualMachineVolumeSource, s conversion.Scope) error { + out.PersistentVolumeClaim = (*v1alpha3.PersistentVolumeClaimVolumeSource)(unsafe.Pointer(in.PersistentVolumeClaim)) + return nil +} + +// Convert_v1alpha2_VirtualMachineVolumeSource_To_v1alpha3_VirtualMachineVolumeSource is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineVolumeSource_To_v1alpha3_VirtualMachineVolumeSource(in *VirtualMachineVolumeSource, out *v1alpha3.VirtualMachineVolumeSource, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineVolumeSource_To_v1alpha3_VirtualMachineVolumeSource(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineVolumeSource_To_v1alpha2_VirtualMachineVolumeSource(in *v1alpha3.VirtualMachineVolumeSource, out *VirtualMachineVolumeSource, s conversion.Scope) error { + out.PersistentVolumeClaim = (*PersistentVolumeClaimVolumeSource)(unsafe.Pointer(in.PersistentVolumeClaim)) + return nil +} + +// Convert_v1alpha3_VirtualMachineVolumeSource_To_v1alpha2_VirtualMachineVolumeSource is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineVolumeSource_To_v1alpha2_VirtualMachineVolumeSource(in *v1alpha3.VirtualMachineVolumeSource, out *VirtualMachineVolumeSource, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineVolumeSource_To_v1alpha2_VirtualMachineVolumeSource(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineVolumeStatus_To_v1alpha3_VirtualMachineVolumeStatus(in *VirtualMachineVolumeStatus, out *v1alpha3.VirtualMachineVolumeStatus, s conversion.Scope) error { + out.Name = in.Name + out.Attached = in.Attached + out.DiskUUID = in.DiskUUID + out.Error = in.Error + return nil +} + +// Convert_v1alpha2_VirtualMachineVolumeStatus_To_v1alpha3_VirtualMachineVolumeStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineVolumeStatus_To_v1alpha3_VirtualMachineVolumeStatus(in *VirtualMachineVolumeStatus, out *v1alpha3.VirtualMachineVolumeStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineVolumeStatus_To_v1alpha3_VirtualMachineVolumeStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineVolumeStatus_To_v1alpha2_VirtualMachineVolumeStatus(in *v1alpha3.VirtualMachineVolumeStatus, out *VirtualMachineVolumeStatus, s conversion.Scope) error { + out.Name = in.Name + out.Attached = in.Attached + out.DiskUUID = in.DiskUUID + out.Error = in.Error + return nil +} + +// Convert_v1alpha3_VirtualMachineVolumeStatus_To_v1alpha2_VirtualMachineVolumeStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineVolumeStatus_To_v1alpha2_VirtualMachineVolumeStatus(in *v1alpha3.VirtualMachineVolumeStatus, out *VirtualMachineVolumeStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineVolumeStatus_To_v1alpha2_VirtualMachineVolumeStatus(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineWebConsoleRequest_To_v1alpha3_VirtualMachineWebConsoleRequest(in *VirtualMachineWebConsoleRequest, out *v1alpha3.VirtualMachineWebConsoleRequest, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha2_VirtualMachineWebConsoleRequestSpec_To_v1alpha3_VirtualMachineWebConsoleRequestSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha2_VirtualMachineWebConsoleRequestStatus_To_v1alpha3_VirtualMachineWebConsoleRequestStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_VirtualMachineWebConsoleRequest_To_v1alpha3_VirtualMachineWebConsoleRequest is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineWebConsoleRequest_To_v1alpha3_VirtualMachineWebConsoleRequest(in *VirtualMachineWebConsoleRequest, out *v1alpha3.VirtualMachineWebConsoleRequest, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineWebConsoleRequest_To_v1alpha3_VirtualMachineWebConsoleRequest(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineWebConsoleRequest_To_v1alpha2_VirtualMachineWebConsoleRequest(in *v1alpha3.VirtualMachineWebConsoleRequest, out *VirtualMachineWebConsoleRequest, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_VirtualMachineWebConsoleRequestSpec_To_v1alpha2_VirtualMachineWebConsoleRequestSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha3_VirtualMachineWebConsoleRequestStatus_To_v1alpha2_VirtualMachineWebConsoleRequestStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_VirtualMachineWebConsoleRequest_To_v1alpha2_VirtualMachineWebConsoleRequest is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineWebConsoleRequest_To_v1alpha2_VirtualMachineWebConsoleRequest(in *v1alpha3.VirtualMachineWebConsoleRequest, out *VirtualMachineWebConsoleRequest, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineWebConsoleRequest_To_v1alpha2_VirtualMachineWebConsoleRequest(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineWebConsoleRequestList_To_v1alpha3_VirtualMachineWebConsoleRequestList(in *VirtualMachineWebConsoleRequestList, out *v1alpha3.VirtualMachineWebConsoleRequestList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha3.VirtualMachineWebConsoleRequest)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha2_VirtualMachineWebConsoleRequestList_To_v1alpha3_VirtualMachineWebConsoleRequestList is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineWebConsoleRequestList_To_v1alpha3_VirtualMachineWebConsoleRequestList(in *VirtualMachineWebConsoleRequestList, out *v1alpha3.VirtualMachineWebConsoleRequestList, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineWebConsoleRequestList_To_v1alpha3_VirtualMachineWebConsoleRequestList(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineWebConsoleRequestList_To_v1alpha2_VirtualMachineWebConsoleRequestList(in *v1alpha3.VirtualMachineWebConsoleRequestList, out *VirtualMachineWebConsoleRequestList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]VirtualMachineWebConsoleRequest)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha3_VirtualMachineWebConsoleRequestList_To_v1alpha2_VirtualMachineWebConsoleRequestList is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineWebConsoleRequestList_To_v1alpha2_VirtualMachineWebConsoleRequestList(in *v1alpha3.VirtualMachineWebConsoleRequestList, out *VirtualMachineWebConsoleRequestList, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineWebConsoleRequestList_To_v1alpha2_VirtualMachineWebConsoleRequestList(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineWebConsoleRequestSpec_To_v1alpha3_VirtualMachineWebConsoleRequestSpec(in *VirtualMachineWebConsoleRequestSpec, out *v1alpha3.VirtualMachineWebConsoleRequestSpec, s conversion.Scope) error { + out.Name = in.Name + out.PublicKey = in.PublicKey + return nil +} + +// Convert_v1alpha2_VirtualMachineWebConsoleRequestSpec_To_v1alpha3_VirtualMachineWebConsoleRequestSpec is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineWebConsoleRequestSpec_To_v1alpha3_VirtualMachineWebConsoleRequestSpec(in *VirtualMachineWebConsoleRequestSpec, out *v1alpha3.VirtualMachineWebConsoleRequestSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineWebConsoleRequestSpec_To_v1alpha3_VirtualMachineWebConsoleRequestSpec(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineWebConsoleRequestSpec_To_v1alpha2_VirtualMachineWebConsoleRequestSpec(in *v1alpha3.VirtualMachineWebConsoleRequestSpec, out *VirtualMachineWebConsoleRequestSpec, s conversion.Scope) error { + out.Name = in.Name + out.PublicKey = in.PublicKey + return nil +} + +// Convert_v1alpha3_VirtualMachineWebConsoleRequestSpec_To_v1alpha2_VirtualMachineWebConsoleRequestSpec is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineWebConsoleRequestSpec_To_v1alpha2_VirtualMachineWebConsoleRequestSpec(in *v1alpha3.VirtualMachineWebConsoleRequestSpec, out *VirtualMachineWebConsoleRequestSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineWebConsoleRequestSpec_To_v1alpha2_VirtualMachineWebConsoleRequestSpec(in, out, s) +} + +func autoConvert_v1alpha2_VirtualMachineWebConsoleRequestStatus_To_v1alpha3_VirtualMachineWebConsoleRequestStatus(in *VirtualMachineWebConsoleRequestStatus, out *v1alpha3.VirtualMachineWebConsoleRequestStatus, s conversion.Scope) error { + out.Response = in.Response + out.ExpiryTime = in.ExpiryTime + out.ProxyAddr = in.ProxyAddr + return nil +} + +// Convert_v1alpha2_VirtualMachineWebConsoleRequestStatus_To_v1alpha3_VirtualMachineWebConsoleRequestStatus is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineWebConsoleRequestStatus_To_v1alpha3_VirtualMachineWebConsoleRequestStatus(in *VirtualMachineWebConsoleRequestStatus, out *v1alpha3.VirtualMachineWebConsoleRequestStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineWebConsoleRequestStatus_To_v1alpha3_VirtualMachineWebConsoleRequestStatus(in, out, s) +} + +func autoConvert_v1alpha3_VirtualMachineWebConsoleRequestStatus_To_v1alpha2_VirtualMachineWebConsoleRequestStatus(in *v1alpha3.VirtualMachineWebConsoleRequestStatus, out *VirtualMachineWebConsoleRequestStatus, s conversion.Scope) error { + out.Response = in.Response + out.ExpiryTime = in.ExpiryTime + out.ProxyAddr = in.ProxyAddr + return nil +} + +// Convert_v1alpha3_VirtualMachineWebConsoleRequestStatus_To_v1alpha2_VirtualMachineWebConsoleRequestStatus is an autogenerated conversion function. +func Convert_v1alpha3_VirtualMachineWebConsoleRequestStatus_To_v1alpha2_VirtualMachineWebConsoleRequestStatus(in *v1alpha3.VirtualMachineWebConsoleRequestStatus, out *VirtualMachineWebConsoleRequestStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_VirtualMachineWebConsoleRequestStatus_To_v1alpha2_VirtualMachineWebConsoleRequestStatus(in, out, s) +} diff --git a/api/v1alpha2/zz_generated.deepcopy.go b/api/v1alpha2/zz_generated.deepcopy.go index 96cc5500a..423f052ed 100644 --- a/api/v1alpha2/zz_generated.deepcopy.go +++ b/api/v1alpha2/zz_generated.deepcopy.go @@ -1,6 +1,6 @@ //go:build !ignore_autogenerated -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // Code generated by controller-gen. DO NOT EDIT. @@ -21,7 +21,7 @@ func (in *ClusterVirtualMachineImage) DeepCopyInto(out *ClusterVirtualMachineIma *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec + in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) } @@ -726,7 +726,7 @@ func (in *VirtualMachineImage) DeepCopyInto(out *VirtualMachineImage) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec + in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) } @@ -813,7 +813,11 @@ func (in *VirtualMachineImageProductInfo) DeepCopy() *VirtualMachineImageProduct // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualMachineImageSpec) DeepCopyInto(out *VirtualMachineImageSpec) { *out = *in - out.ProviderRef = in.ProviderRef + if in.ProviderRef != nil { + in, out := &in.ProviderRef, &out.ProviderRef + *out = new(common.LocalObjectRef) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineImageSpec. @@ -1225,7 +1229,11 @@ func (in *VirtualMachineNetworkInterfaceIPStatus) DeepCopy() *VirtualMachineNetw // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualMachineNetworkInterfaceSpec) DeepCopyInto(out *VirtualMachineNetworkInterfaceSpec) { *out = *in - out.Network = in.Network + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(common.PartialObjectRef) + **out = **in + } if in.Addresses != nil { in, out := &in.Addresses, &out.Addresses *out = make([]string, len(*in)) diff --git a/api/v1alpha3/cloudinit/cloudconfig.go b/api/v1alpha3/cloudinit/cloudconfig.go new file mode 100644 index 000000000..3ec3f0fba --- /dev/null +++ b/api/v1alpha3/cloudinit/cloudconfig.go @@ -0,0 +1,324 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// +kubebuilder:object:generate=true + +package cloudinit + +import ( + "encoding/json" + + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" +) + +// CloudConfig is the VM Operator API subset of a Cloud-Init CloudConfig and +// contains several of the CloudConfig's frequently used modules. +type CloudConfig struct { + // Timezone describes the timezone represented in /usr/share/zoneinfo. + // + // +optional + Timezone string `json:"timezone,omitempty"` + + // DefaultUserEnabled may be set to true to ensure even if the Users field + // is not empty, the default user is still created on systems that have one + // defined. By default, Cloud-Init ignores the default user if the + // CloudConfig provides one or more non-default users via the Users field. + // + // +optional + DefaultUserEnabled bool `json:"defaultUserEnabled,omitempty"` + + // Users allows adding/configuring one or more users on the guest. + // + // +optional + // +listType=map + // +listMapKey=name + Users []User `json:"users,omitempty"` + + // RunCmd allows running one or more commands on the guest. + // The entries in this list can adhere to two, different formats: + // + // Format 1 -- a string that contains the command and its arguments, ex. + // + // runcmd: + // - "ls -al" + // + // Format 2 -- a list of the command and its arguments, ex. + // + // runcmd: + // - - echo + // - "Hello, world." + // + // +optional + // +kubebuilder:validation:Schemaless + // +kubebuilder:pruning:PreserveUnknownFields + RunCmd json.RawMessage `json:"runcmd,omitempty"` + + // WriteFiles + // + // +optional + // +listType=map + // +listMapKey=path + WriteFiles []WriteFile `json:"write_files,omitempty"` + + // SSHPwdAuth sets whether or not to accept password authentication. ``true`` will enable password + // auth. ``false`` will disable. Default: leave the value unchanged. In order for this + // config to be applied, SSH may need to be restarted. On systemd systems, this restart will + // only happen if the SSH service has already been started. On non-systemd systems, a + // restart will be attempted regardless of the service state. + // + // +optional + SSHPwdAuth *bool `json:"ssh_pwauth,omitempty"` +} + +// User is a CloudConfig user data structure. +type User struct { + // CreateGroups is a flag that may be set to false to disable creation of + // specified user groups. + // + // Defaults to true when Name is not "default". + // + // +optional + CreateGroups *bool `json:"create_groups,omitempty"` + + // ExpireData is the date on which the user's account will be disabled. + // + // +optional + ExpireDate *string `json:"expiredate,omitempty"` + + // Gecos is an optional comment about the user, usually a comma-separated + // string of the user's real name and contact information. + // + // +optional + Gecos *string `json:"gecos,omitempty"` + + // Groups is an optional list of groups to add to the user. + // + // +optional + Groups []string `json:"groups,omitempty"` + + // HashedPasswd is a hash of the user's password that will be applied even + // if the specified user already exists. + // + // +optional + HashedPasswd *common.SecretKeySelector `json:"hashed_passwd,omitempty"` + + // Homedir is the optional home directory for the user. + // + // Defaults to "/home/" when Name is not "default". + // + // +optional + Homedir *string `json:"homedir,omitempty"` + + // Inactive optionally represents the number of days until the user is + // disabled. + // + // +optional + Inactive *int32 `json:"inactive,omitempty"` + + // LockPasswd disables password login. + // + // Defaults to true when Name is not "default". + // + // +optional + LockPasswd *bool `json:"lock_passwd,omitempty"` + + // Name is the user's login name. + // + // Please note this field may be set to the special value of "default" when + // this User is the first element in the Users list from the CloudConfig. + // When set to "default", all other fields from this User must be nil. + Name string `json:"name"` + + // NoCreateHome prevents the creation of the home directory. + // + // Defaults to false when Name is not "default". + // + // +optional + NoCreateHome *bool `json:"no_create_home,omitempty"` + + // NoLogInit prevents the initialization of lastlog and faillog for the + // user. + // + // Defaults to false when Name is not "default". + // + // +optional + NoLogInit *bool `json:"no_log_init,omitempty"` + + // NoUserGroup prevents the creation of the group named after the user. + // + // Defaults to false when Name is not "default". + // + // +optional + NoUserGroup *bool `json:"no_user_group,omitempty"` + + // Passwd is a hash of the user's password that will be applied only to + // a newly created user. To apply a new, hashed password to an existing user + // please use HashedPasswd instead. + // + // +optional + Passwd *common.SecretKeySelector `json:"passwd,omitempty"` + + // PrimaryGroup is the primary group for the user. + // + // Defaults to the value of the Name field when it is not "default". + // + // +optional + PrimaryGroup *string `json:"primary_group,omitempty"` + + // SELinuxUser is the SELinux user for the user's login. + // + // +optional + SELinuxUser *string `json:"selinux_user,omitempty"` + + // Shell is the path to the user's login shell. + // + // Please note the default is to set no shell, which results in a + // system-specific default being used. + // + // +optional + Shell *string `json:"shell,omitempty"` + + // SnapUser specifies an e-mail address to create the user as a Snappy user + // through "snap create-user". + // + // If an Ubuntu SSO account is associated with the address, the username and + // SSH keys will be requested from there. + // + // +optional + SnapUser *string `json:"snapuser,omitempty"` + + // SSHAuthorizedKeys is a list of SSH keys to add to the user's authorized + // keys file. + // + // Please note this field may not be combined with SSHRedirectUser. + // + // +optional + SSHAuthorizedKeys []string `json:"ssh_authorized_keys,omitempty"` + + // SSHImportID is a list of SSH IDs to import for the user. + // + // Please note this field may not be combined with SSHRedirectUser. + // + // +optional + SSHImportID []string `json:"ssh_import_id,omitempty"` + + // SSHRedirectUser may be set to true to disable SSH logins for this user. + // + // Please note that when specified, all SSH keys from cloud meta-data will + // be configured in a disabled state for this user. Any SSH login as this + // user will timeout with a message to login instead as the default user. + // + // This field may not be combined with SSHAuthorizedKeys or SSHImportID. + // + // Defaults to false when Name is not "default". + // + // +optional + SSHRedirectUser *bool `json:"ssh_redirect_user,omitempty"` + + // Sudo is a sudo rule to apply to the user. + // + // When omitted, no sudo rules will be applied to the user. + // + // +optional + Sudo *string `json:"sudo,omitempty"` + + // System is an optional flag that indicates the user should be created as + // a system user with no home directory. + // + // Defaults to false when Name is not "default". + // + // +optional + System *bool `json:"system,omitempty"` + + // UID is the user's ID. + // + // When omitted the guest will default to the next available number. + // + // +optional + UID *int64 `json:"uid,omitempty"` +} + +// WriteFileEncoding specifies the encoding type of a file's content. +// +// +kubebuilder:validation:Enum=b64;base64;gz;gzip;"gz+b64";"gz+base64";"gzip+b64";"gzip+base64";"text/plain" +type WriteFileEncoding string + +const ( + WriteFileEncodingFluffyB64 WriteFileEncoding = "b64" + WriteFileEncodingFluffyBase64 WriteFileEncoding = "base64" + WriteFileEncodingFluffyGz WriteFileEncoding = "gz" + WriteFileEncodingFluffyGzip WriteFileEncoding = "gzip" + WriteFileEncodingGzB64 WriteFileEncoding = "gz+b64" + WriteFileEncodingGzBase64 WriteFileEncoding = "gz+base64" + WriteFileEncodingGzipB64 WriteFileEncoding = "gzip+b64" + WriteFileEncodingGzipBase64 WriteFileEncoding = "gzip+base64" + WriteFileEncodingTextPlain WriteFileEncoding = "text/plain" +) + +// WriteFile is a CloudConfig +// write_file data structure. +type WriteFile struct { + // Append specifies whether or not to append the content to an existing file + // if the file specified by Path already exists. + // + // +optional + Append bool `json:"append,omitempty"` + + // Content is the optional content to write to the provided Path. + // + // When omitted an empty file will be created or existing file will be + // modified. + // + // The value for this field can adhere to two, different formats: + // + // Format 1 -- a string that contains the command and its arguments, ex. + // + // content: Hello, world. + // + // Please note that format 1 supports all of the manners of specifying a + // YAML string. + // + // Format 2 -- a secret reference with the name of the key that contains + // the content for the file, ex. + // + // content: + // name: my-bootstrap-secret + // key: my-file-content + // + // +optional + // +kubebuilder:validation:Schemaless + // +kubebuilder:pruning:PreserveUnknownFields + Content json.RawMessage `json:"content,omitempty"` + + // Defer indicates to defer writing the file until Cloud-Init's "final" + // stage, after users are created and packages are installed. + // + // +optional + Defer bool `json:"defer,omitempty"` + + // Encoding is an optional encoding type of the content. + // + // +optional + // +kubebuilder:default="text/plain" + Encoding WriteFileEncoding `json:"encoding,omitempty"` + + // Owner is an optional "owner:group" to chown the file. + // + // +optional + // +kubebuilder:default="root:root" + Owner string `json:"owner,omitempty"` + + // Path is the path of the file to which the content is decoded and written. + Path string `json:"path"` + + // Permissions an optional set of file permissions to set. + // + // Please note the permissions should be specified as an octal string, ex. + // "0###". + // + // When omitted the guest will default this value to "0644". + // + // +optional + // +kubebuilder:default="0644" + Permissions string `json:"permissions,omitempty"` +} diff --git a/api/v1alpha3/cloudinit/zz_generated.deepcopy.go b/api/v1alpha3/cloudinit/zz_generated.deepcopy.go new file mode 100644 index 000000000..e53f4fc75 --- /dev/null +++ b/api/v1alpha3/cloudinit/zz_generated.deepcopy.go @@ -0,0 +1,197 @@ +//go:build !ignore_autogenerated + +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by controller-gen. DO NOT EDIT. + +package cloudinit + +import ( + "encoding/json" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudConfig) DeepCopyInto(out *CloudConfig) { + *out = *in + if in.Users != nil { + in, out := &in.Users, &out.Users + *out = make([]User, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RunCmd != nil { + in, out := &in.RunCmd, &out.RunCmd + *out = make(json.RawMessage, len(*in)) + copy(*out, *in) + } + if in.WriteFiles != nil { + in, out := &in.WriteFiles, &out.WriteFiles + *out = make([]WriteFile, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SSHPwdAuth != nil { + in, out := &in.SSHPwdAuth, &out.SSHPwdAuth + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudConfig. +func (in *CloudConfig) DeepCopy() *CloudConfig { + if in == nil { + return nil + } + out := new(CloudConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *User) DeepCopyInto(out *User) { + *out = *in + if in.CreateGroups != nil { + in, out := &in.CreateGroups, &out.CreateGroups + *out = new(bool) + **out = **in + } + if in.ExpireDate != nil { + in, out := &in.ExpireDate, &out.ExpireDate + *out = new(string) + **out = **in + } + if in.Gecos != nil { + in, out := &in.Gecos, &out.Gecos + *out = new(string) + **out = **in + } + if in.Groups != nil { + in, out := &in.Groups, &out.Groups + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.HashedPasswd != nil { + in, out := &in.HashedPasswd, &out.HashedPasswd + *out = new(common.SecretKeySelector) + **out = **in + } + if in.Homedir != nil { + in, out := &in.Homedir, &out.Homedir + *out = new(string) + **out = **in + } + if in.Inactive != nil { + in, out := &in.Inactive, &out.Inactive + *out = new(int32) + **out = **in + } + if in.LockPasswd != nil { + in, out := &in.LockPasswd, &out.LockPasswd + *out = new(bool) + **out = **in + } + if in.NoCreateHome != nil { + in, out := &in.NoCreateHome, &out.NoCreateHome + *out = new(bool) + **out = **in + } + if in.NoLogInit != nil { + in, out := &in.NoLogInit, &out.NoLogInit + *out = new(bool) + **out = **in + } + if in.NoUserGroup != nil { + in, out := &in.NoUserGroup, &out.NoUserGroup + *out = new(bool) + **out = **in + } + if in.Passwd != nil { + in, out := &in.Passwd, &out.Passwd + *out = new(common.SecretKeySelector) + **out = **in + } + if in.PrimaryGroup != nil { + in, out := &in.PrimaryGroup, &out.PrimaryGroup + *out = new(string) + **out = **in + } + if in.SELinuxUser != nil { + in, out := &in.SELinuxUser, &out.SELinuxUser + *out = new(string) + **out = **in + } + if in.Shell != nil { + in, out := &in.Shell, &out.Shell + *out = new(string) + **out = **in + } + if in.SnapUser != nil { + in, out := &in.SnapUser, &out.SnapUser + *out = new(string) + **out = **in + } + if in.SSHAuthorizedKeys != nil { + in, out := &in.SSHAuthorizedKeys, &out.SSHAuthorizedKeys + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SSHImportID != nil { + in, out := &in.SSHImportID, &out.SSHImportID + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SSHRedirectUser != nil { + in, out := &in.SSHRedirectUser, &out.SSHRedirectUser + *out = new(bool) + **out = **in + } + if in.Sudo != nil { + in, out := &in.Sudo, &out.Sudo + *out = new(string) + **out = **in + } + if in.System != nil { + in, out := &in.System, &out.System + *out = new(bool) + **out = **in + } + if in.UID != nil { + in, out := &in.UID, &out.UID + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new User. +func (in *User) DeepCopy() *User { + if in == nil { + return nil + } + out := new(User) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WriteFile) DeepCopyInto(out *WriteFile) { + *out = *in + if in.Content != nil { + in, out := &in.Content, &out.Content + *out = make(json.RawMessage, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WriteFile. +func (in *WriteFile) DeepCopy() *WriteFile { + if in == nil { + return nil + } + out := new(WriteFile) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha3/common/types.go b/api/v1alpha3/common/types.go new file mode 100644 index 000000000..be7897030 --- /dev/null +++ b/api/v1alpha3/common/types.go @@ -0,0 +1,99 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// +kubebuilder:object:generate=true + +package common + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// LocalObjectRef describes a reference to another object in the same +// namespace as the referrer. +type LocalObjectRef struct { + // 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 + APIVersion string `json:"apiVersion"` + + // 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 + Kind string `json:"kind"` + + // Name refers to a unique resource in the current namespace. + // More info: http://kubernetes.io/docs/user-guide/identifiers#names + Name string `json:"name"` +} + +// PartialObjectRef describes a reference to another object in the same +// namespace as the referrer. The reference can be just a name but may also +// include the referred resource's APIVersion and Kind. +type PartialObjectRef struct { + metav1.TypeMeta `json:",inline"` + + // Name refers to a unique resource in the current namespace. + // More info: http://kubernetes.io/docs/user-guide/identifiers#names + Name string `json:"name"` +} + +// SecretKeySelector references data from a Secret resource by a specific key. +type SecretKeySelector struct { + // Name is the name of the secret. + Name string `json:"name"` + + // Key is the key in the secret that specifies the requested data. + Key string `json:"key"` +} + +// ValueOrSecretKeySelector describes a value from either a SecretKeySelector +// or value directly in this object. +type ValueOrSecretKeySelector struct { + // From is specified to reference a value from a Secret resource. + // + // Please note this field is mutually exclusive with the Value field. + // + // +optional + From *SecretKeySelector `json:"from,omitempty"` + + // Value is used to directly specify a value. + // + // Please note this field is mutually exclusive with the From field. + // + // +optional + Value *string `json:"value,omitempty"` +} + +// KeyValuePair is useful when wanting to realize a map as a list of key/value +// pairs. +type KeyValuePair struct { + // Key is the key part of the key/value pair. + Key string `json:"key"` + // Value is the optional value part of the key/value pair. + // +optional + Value string `json:"value,omitempty"` +} + +// KeyValueOrSecretKeySelectorPair is useful when wanting to realize a map as a +// list of key/value pairs where each value could also reference data stored in +// a Secret resource. +type KeyValueOrSecretKeySelectorPair struct { + // Key is the key part of the key/value pair. + Key string `json:"key"` + // Value is the optional value part of the key/value pair. + // +optional + Value ValueOrSecretKeySelector `json:"value,omitempty"` +} + +// NameValuePair is useful when wanting to realize a map as a list of name/value +// pairs. +type NameValuePair struct { + // Name is the name part of the name/value pair. + Name string `json:"name"` + // Value is the optional value part of the name/value pair. + // +optional + Value string `json:"value,omitempty"` +} diff --git a/api/v1alpha3/common/zz_generated.deepcopy.go b/api/v1alpha3/common/zz_generated.deepcopy.go new file mode 100644 index 000000000..7a5ac5fcd --- /dev/null +++ b/api/v1alpha3/common/zz_generated.deepcopy.go @@ -0,0 +1,127 @@ +//go:build !ignore_autogenerated + +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by controller-gen. DO NOT EDIT. + +package common + +import () + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KeyValueOrSecretKeySelectorPair) DeepCopyInto(out *KeyValueOrSecretKeySelectorPair) { + *out = *in + in.Value.DeepCopyInto(&out.Value) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyValueOrSecretKeySelectorPair. +func (in *KeyValueOrSecretKeySelectorPair) DeepCopy() *KeyValueOrSecretKeySelectorPair { + if in == nil { + return nil + } + out := new(KeyValueOrSecretKeySelectorPair) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KeyValuePair) DeepCopyInto(out *KeyValuePair) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyValuePair. +func (in *KeyValuePair) DeepCopy() *KeyValuePair { + if in == nil { + return nil + } + out := new(KeyValuePair) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalObjectRef) DeepCopyInto(out *LocalObjectRef) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalObjectRef. +func (in *LocalObjectRef) DeepCopy() *LocalObjectRef { + if in == nil { + return nil + } + out := new(LocalObjectRef) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NameValuePair) DeepCopyInto(out *NameValuePair) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NameValuePair. +func (in *NameValuePair) DeepCopy() *NameValuePair { + if in == nil { + return nil + } + out := new(NameValuePair) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PartialObjectRef) DeepCopyInto(out *PartialObjectRef) { + *out = *in + out.TypeMeta = in.TypeMeta +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PartialObjectRef. +func (in *PartialObjectRef) DeepCopy() *PartialObjectRef { + if in == nil { + return nil + } + out := new(PartialObjectRef) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretKeySelector) DeepCopyInto(out *SecretKeySelector) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretKeySelector. +func (in *SecretKeySelector) DeepCopy() *SecretKeySelector { + if in == nil { + return nil + } + out := new(SecretKeySelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ValueOrSecretKeySelector) DeepCopyInto(out *ValueOrSecretKeySelector) { + *out = *in + if in.From != nil { + in, out := &in.From, &out.From + *out = new(SecretKeySelector) + **out = **in + } + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValueOrSecretKeySelector. +func (in *ValueOrSecretKeySelector) DeepCopy() *ValueOrSecretKeySelector { + if in == nil { + return nil + } + out := new(ValueOrSecretKeySelector) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha3/condition_consts.go b/api/v1alpha3/condition_consts.go new file mode 100644 index 000000000..b705c8c64 --- /dev/null +++ b/api/v1alpha3/condition_consts.go @@ -0,0 +1,9 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +const ( + // ReadyConditionType is the Ready condition type that summarizes the operational state of a VM Operator API object. + ReadyConditionType = "Ready" +) diff --git a/api/v1alpha3/doc.go b/api/v1alpha3/doc.go new file mode 100644 index 000000000..08e2db9d2 --- /dev/null +++ b/api/v1alpha3/doc.go @@ -0,0 +1,7 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// +k8s:openapi-gen=true +// +kubebuilder:object:generate=true +// +groupName=vmoperator.vmware.com +package v1alpha3 diff --git a/api/v1alpha3/groupversion_info.go b/api/v1alpha3/groupversion_info.go new file mode 100644 index 000000000..6e62562c0 --- /dev/null +++ b/api/v1alpha3/groupversion_info.go @@ -0,0 +1,23 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +// GroupName specifies the group name used to register the objects. +const GroupName = "vmoperator.vmware.com" + +var ( + // SchemeGroupVersion is group version used to register these objects + SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha3"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/api/v1alpha3/sysprep/sysprep.go b/api/v1alpha3/sysprep/sysprep.go new file mode 100644 index 000000000..4b2f675c5 --- /dev/null +++ b/api/v1alpha3/sysprep/sysprep.go @@ -0,0 +1,224 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// +kubebuilder:object:generate=true + +package sysprep + +// Sysprep describes the object representation of a Windows sysprep.xml answer +// file. +// +// All fields and their values are transferred into the sysprep.xml file that +// VirtualCenter stores on the target virtual disk. +// +// For more detailed information, please see +// https://technet.microsoft.com/en-us/library/cc771830(v=ws.10).aspx. +type Sysprep struct { + + // GUIRunOnce is a representation of the Sysprep GuiRunOnce key. + // + // +optional + GUIRunOnce GUIRunOnce `json:"guiRunOnce,omitempty"` + + // GUIUnattended is a representation of the Sysprep GUIUnattended key. + GUIUnattended *GUIUnattended `json:"guiUnattended,omitempty"` + + // Identification is a representation of the Sysprep Identification key. + Identification *Identification `json:"identification,omitempty"` + + // LicenseFilePrintData is a representation of the Sysprep + // LicenseFilePrintData key. + // + // Please note this is required only for Windows 2000 Server and Windows + // Server 2003. + // + // +optional + LicenseFilePrintData *LicenseFilePrintData `json:"licenseFilePrintData,omitempty"` + + // UserData is a representation of the Sysprep UserData key. + UserData *UserData `json:"userData"` +} + +// GUIRunOnce maps to the GuiRunOnce key in the sysprep.xml answer file. +type GUIRunOnce struct { + // Commands is a list of commands to run at first user logon, after guest + // customization. + // + // +optional + Commands []string `json:"commands,omitempty"` +} + +// GUIUnattended maps to the GuiUnattended key in the sysprep.xml answer file. +type GUIUnattended struct { + + // AutoLogon determine whether the machine automatically logs on as + // Administrator. + // + // Please note if AutoLogon is true, then Password must be set or guest + // customization will fail. + // + // +optional + AutoLogon bool `json:"autoLogon,omitempty"` + + // AutoLogonCount specifies the number of times the machine should + // automatically log on as Administrator. + // + // Generally it should be 1, but if your setup requires a number of reboots, + // you may want to increase it. This number may be determined by the list of + // commands executed by the GuiRunOnce command. + // + // Please note this field must be specified with a non-zero positive integer if AutoLogon is true. + // + // +optional + AutoLogonCount int32 `json:"autoLogonCount,omitempty"` + + // Password is the new administrator password for the machine. + // + // To specify that the password should be set to blank (that is, no + // password), set the password value to NULL. Because of encryption, "" is + // NOT a valid value. + // + // Please note if the password is set to blank and AutoLogon is true, the + // guest customization will fail. + // + // If the XML file is generated by the VirtualCenter Customization Wizard, + // then the password is encrypted. Otherwise, the client should set the + // plainText attribute to true, so that the customization process does not + // attempt to decrypt the string. + // + // When not explicitly specified, the Key field for the selector defaults to + // `password`. + // + // +optional + Password *PasswordSecretKeySelector `json:"password,omitempty"` + + // TimeZone is the time zone index for the virtual machine. + // + // Please note that numbers correspond to time zones listed at + // https://bit.ly/3Rzv8oL. + // + // +optional + TimeZone int32 `json:"timeZone,omitempty"` +} + +// PasswordSecretKeySelector references the password value from a Secret resource +type PasswordSecretKeySelector struct { + // Name is the name of the secret. + Name string `json:"name"` + + // Key is the key in the secret that specifies the requested data. + // +kubebuilder:default=password + Key string `json:"key"` +} + +// Identification maps to the Identification key in the sysprep.xml answer file +// and provides information needed to join a workgroup or domain. +type Identification struct { + + // DomainAdmin is the domain user account used for authentication if the + // virtual machine is joining a domain. The user does not need to be a + // domain administrator, but the account must have the privileges required + // to add computers to the domain. + // + // +optional + DomainAdmin string `json:"domainAdmin,omitempty"` + + // DomainAdminPassword is the password for the domain user account used for + // authentication if the virtual machine is joining a domain. + // + // When not explicitly specified, the Key field for the selector defaults to + // `domain_admin_password`. + // + // +optional + DomainAdminPassword *DomainPasswordSecretKeySelector `json:"domainAdminPassword,omitempty"` + + // JoinDomain is the domain that the virtual machine should join. If this + // value is supplied, then DomainAdmin and DomainAdminPassword must also be + // supplied, and the JoinWorkgroup name must be empty. + // + // +optional + JoinDomain string `json:"joinDomain,omitempty"` + + // JoinWorkgroup is the workgroup that the virtual machine should join. If + // this value is supplied, then the JoinDomain and the authentication fields + // (DomainAdmin and DomainAdminPassword) must be empty. + // + // +optional + JoinWorkgroup string `json:"joinWorkgroup,omitempty"` +} + +// DomainPasswordSecretKeySelector references the password value from a Secret resource +type DomainPasswordSecretKeySelector struct { + // Name is the name of the secret. + Name string `json:"name"` + + // Key is the key in the secret that specifies the requested data. + // +kubebuilder:default=domain_admin_password + Key string `json:"key"` +} + +// CustomizationLicenseDataMode is an enumeration of the different license +// modes. +// +// +kubebuilder:validation:Enum=perSeat;perServer +type CustomizationLicenseDataMode string + +const ( + // CustomizationLicenseDataModePerSeat indicates that a client access + // license has been purchased for each computer that accesses the + // VirtualCenter server. + CustomizationLicenseDataModePerSeat CustomizationLicenseDataMode = "perSeat" + + // CustomizationLicenseDataModePerServer indicates that client access + // licenses have been purchased for the server, allowing a certain number of + // concurrent connections to the VirtualCenter server. + CustomizationLicenseDataModePerServer CustomizationLicenseDataMode = "perServer" +) + +// LicenseFilePrintData maps to the LicenseFilePrintData key in the sysprep.xml +// answer file and provides information needed to join a workgroup or domain. +type LicenseFilePrintData struct { + + // AutoMode specifies the server licensing mode. + AutoMode CustomizationLicenseDataMode `json:"autoMode"` + + // AutoUsers indicates the number of client licenses purchased for the + // VirtualCenter server being installed. + // + // Please note this value is ignored unless AutoMode is PerServer. + // + // +optional + AutoUsers *int32 `json:"autoUsers,omitempty"` +} + +// UserData maps to the UserData key in the sysprep.xml answer file and provides +// personal data pertaining to the owner of the virtual machine. +type UserData struct { + + // FullName is the user's full name. + FullName string `json:"fullName"` + + // OrgName is the name of the user's organization. + OrgName string `json:"orgName"` + + // ProductID is a valid serial number. + // + // Please note unless the VirtualMachineImage was installed with a volume + // license key, ProductID must be set or guest customization will fail. + // + // When not explicitly specified, the Key field for the selector defaults to + // `domain_admin_password`. + // + // +optional + ProductID *ProductIDSecretKeySelector `json:"productID,omitempty"` +} + +// ProductIDSecretKeySelector references the ProductID value from a Secret resource +type ProductIDSecretKeySelector struct { + // Name is the name of the secret. + Name string `json:"name"` + + // Key is the key in the secret that specifies the requested data. + // +kubebuilder:default=product_id + Key string `json:"key"` +} diff --git a/api/v1alpha3/sysprep/zz_generated.deepcopy.go b/api/v1alpha3/sysprep/zz_generated.deepcopy.go new file mode 100644 index 000000000..45243161a --- /dev/null +++ b/api/v1alpha3/sysprep/zz_generated.deepcopy.go @@ -0,0 +1,191 @@ +//go:build !ignore_autogenerated + +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by controller-gen. DO NOT EDIT. + +package sysprep + +import () + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainPasswordSecretKeySelector) DeepCopyInto(out *DomainPasswordSecretKeySelector) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainPasswordSecretKeySelector. +func (in *DomainPasswordSecretKeySelector) DeepCopy() *DomainPasswordSecretKeySelector { + if in == nil { + return nil + } + out := new(DomainPasswordSecretKeySelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GUIRunOnce) DeepCopyInto(out *GUIRunOnce) { + *out = *in + if in.Commands != nil { + in, out := &in.Commands, &out.Commands + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GUIRunOnce. +func (in *GUIRunOnce) DeepCopy() *GUIRunOnce { + if in == nil { + return nil + } + out := new(GUIRunOnce) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GUIUnattended) DeepCopyInto(out *GUIUnattended) { + *out = *in + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(PasswordSecretKeySelector) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GUIUnattended. +func (in *GUIUnattended) DeepCopy() *GUIUnattended { + if in == nil { + return nil + } + out := new(GUIUnattended) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identification) DeepCopyInto(out *Identification) { + *out = *in + if in.DomainAdminPassword != nil { + in, out := &in.DomainAdminPassword, &out.DomainAdminPassword + *out = new(DomainPasswordSecretKeySelector) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identification. +func (in *Identification) DeepCopy() *Identification { + if in == nil { + return nil + } + out := new(Identification) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LicenseFilePrintData) DeepCopyInto(out *LicenseFilePrintData) { + *out = *in + if in.AutoUsers != nil { + in, out := &in.AutoUsers, &out.AutoUsers + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LicenseFilePrintData. +func (in *LicenseFilePrintData) DeepCopy() *LicenseFilePrintData { + if in == nil { + return nil + } + out := new(LicenseFilePrintData) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PasswordSecretKeySelector) DeepCopyInto(out *PasswordSecretKeySelector) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PasswordSecretKeySelector. +func (in *PasswordSecretKeySelector) DeepCopy() *PasswordSecretKeySelector { + if in == nil { + return nil + } + out := new(PasswordSecretKeySelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProductIDSecretKeySelector) DeepCopyInto(out *ProductIDSecretKeySelector) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProductIDSecretKeySelector. +func (in *ProductIDSecretKeySelector) DeepCopy() *ProductIDSecretKeySelector { + if in == nil { + return nil + } + out := new(ProductIDSecretKeySelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Sysprep) DeepCopyInto(out *Sysprep) { + *out = *in + in.GUIRunOnce.DeepCopyInto(&out.GUIRunOnce) + if in.GUIUnattended != nil { + in, out := &in.GUIUnattended, &out.GUIUnattended + *out = new(GUIUnattended) + (*in).DeepCopyInto(*out) + } + if in.Identification != nil { + in, out := &in.Identification, &out.Identification + *out = new(Identification) + (*in).DeepCopyInto(*out) + } + if in.LicenseFilePrintData != nil { + in, out := &in.LicenseFilePrintData, &out.LicenseFilePrintData + *out = new(LicenseFilePrintData) + (*in).DeepCopyInto(*out) + } + if in.UserData != nil { + in, out := &in.UserData, &out.UserData + *out = new(UserData) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sysprep. +func (in *Sysprep) DeepCopy() *Sysprep { + if in == nil { + return nil + } + out := new(Sysprep) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserData) DeepCopyInto(out *UserData) { + *out = *in + if in.ProductID != nil { + in, out := &in.ProductID, &out.ProductID + *out = new(ProductIDSecretKeySelector) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserData. +func (in *UserData) DeepCopy() *UserData { + if in == nil { + return nil + } + out := new(UserData) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha3/testdata/vm-with-cloudinit.yaml b/api/v1alpha3/testdata/vm-with-cloudinit.yaml new file mode 100644 index 000000000..2304cbb0a --- /dev/null +++ b/api/v1alpha3/testdata/vm-with-cloudinit.yaml @@ -0,0 +1,43 @@ +apiVersion: vmoperator.vmware.com/v1alpha2 +kind: VirtualMachine +metadata: + name: my-vm + namespace: my-namespace +spec: + className: medium + imageName: ubuntu-jammy + network: + interfaces: + - name: eth0 + nameservers: + - 1.1.1.1 + - 8.8.8.8 + searchDomains: + - my.domain.local + - my-other.domain.local + bootstrap: + cloudInit: + cloudConfig: + defaultUserEnabled: true + users: + - name: akutz + primary_group: akutz + groups: + - users + ssh_authorized_keys: + - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSL7uWGj... + runcmd: + - "ls /" + - [ "ls", "-a", "-l", "/" ] + write_files: + - path: /etc/my-plaintext + permissions: '0644' + owner: root:root + content: | + Hello, world. + - path: /etc/my-secret + permissions: '0644' + owner: root:root + content: + name: my-vm-bootstrap-secret + key: etc-my-secret diff --git a/api/v1alpha3/testdata/vm-with-sysprep.yaml b/api/v1alpha3/testdata/vm-with-sysprep.yaml new file mode 100644 index 000000000..1715fbae9 --- /dev/null +++ b/api/v1alpha3/testdata/vm-with-sysprep.yaml @@ -0,0 +1,40 @@ +apiVersion: vmoperator.vmware.com/v1alpha2 +kind: VirtualMachine +metadata: + name: my-vm + namespace: my-namespace +spec: + className: medium + imageName: windows-11 + network: + nameservers: + - 1.1.1.1 + - 8.8.8.8 + searchDomains: + - my.domain.local + - my-other.domain.local + bootstrap: + sysprep: + sysprep: + guiRunOnce: + commands: + - "dir C:" + - "echo Hello" + guiUnattended: + autoLogon: true + password: + name: my-vm-bootstrap-secret + key: password + timeZone: + identification: + domainAdmin: global-admin + domainAdminPassword: + name: my-vm-bootstrap-secret + key: domainAdminPassword + joinDomain: my-ad.local + userData: + fullName: Andrew Kutz + orgName: VMware + productID: + name: my-vm-bootstrap-secret + key: windowsProductKey diff --git a/api/v1alpha3/virtualmachine_bootstrap_types.go b/api/v1alpha3/virtualmachine_bootstrap_types.go new file mode 100644 index 000000000..097b5379c --- /dev/null +++ b/api/v1alpha3/virtualmachine_bootstrap_types.go @@ -0,0 +1,184 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ( + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/cloudinit" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/sysprep" +) + +// VirtualMachineBootstrapSpec defines the desired state of a VM's bootstrap +// configuration. +type VirtualMachineBootstrapSpec struct { + + // CloudInit may be used to bootstrap Linux guests with Cloud-Init or + // Windows guests that support Cloudbase-Init. + // + // The guest's networking stack is configured by Cloud-Init on Linux guests + // and Cloudbase-Init on Windows guests. + // + // Please note this bootstrap provider may not be used in conjunction with + // the other bootstrap providers. + // + // +optional + CloudInit *VirtualMachineBootstrapCloudInitSpec `json:"cloudInit,omitempty"` + + // LinuxPrep may be used to bootstrap Linux guests. + // + // The guest's networking stack is configured by Guest OS Customization + // (GOSC). + // + // Please note this bootstrap provider may be used in conjunction with the + // VAppConfig bootstrap provider when wanting to configure the guest's + // network with GOSC but also send vApp/OVF properties into the guest. + // + // This bootstrap provider may not be used in conjunction with the CloudInit + // or Sysprep bootstrap providers. + // + // +optional + LinuxPrep *VirtualMachineBootstrapLinuxPrepSpec `json:"linuxPrep,omitempty"` + + // Sysprep may be used to bootstrap Windows guests. + // + // The guest's networking stack is configured by Guest OS Customization + // (GOSC). + // + // Please note this bootstrap provider may be used in conjunction with the + // VAppConfig bootstrap provider when wanting to configure the guest's + // network with GOSC but also send vApp/OVF properties into the guest. + // + // This bootstrap provider may not be used in conjunction with the CloudInit + // or LinuxPrep bootstrap providers. + // + // +optional + Sysprep *VirtualMachineBootstrapSysprepSpec `json:"sysprep,omitempty"` + + // VAppConfig may be used to bootstrap guests that rely on vApp properties + // (how VMware surfaces OVF properties on guests) to transport data into the + // guest. + // + // The guest's networking stack may be configured using either vApp + // properties or GOSC. + // + // Many OVFs define one or more properties that are used by the guest to + // bootstrap its networking stack. If the VirtualMachineImage defines one or + // more properties like this, then they can be configured to use the network + // data provided for this VM at runtime by setting these properties to Go + // template strings. + // + // It is also possible to use GOSC to bootstrap this VM's network stack by + // configuring either the LinuxPrep or Sysprep bootstrap providers. + // + // Please note the VAppConfig bootstrap provider in conjunction with the + // LinuxPrep bootstrap provider is the equivalent of setting the v1alpha1 + // VM metadata transport to "OvfEnv". + // + // This bootstrap provider may not be used in conjunction with the CloudInit + // bootstrap provider. + // + // +optional + VAppConfig *VirtualMachineBootstrapVAppConfigSpec `json:"vAppConfig,omitempty"` +} + +// VirtualMachineBootstrapCloudInitSpec describes the CloudInit configuration +// used to bootstrap the VM. +type VirtualMachineBootstrapCloudInitSpec struct { + // CloudConfig describes a subset of a Cloud-Init CloudConfig, used to + // bootstrap the VM. + // + // Please note this field and RawCloudConfig are mutually exclusive. + // + // +optional + CloudConfig *cloudinit.CloudConfig `json:"cloudConfig,omitempty"` + + // RawCloudConfig describes a key in a Secret resource that contains the + // CloudConfig data used to bootstrap the VM. + // + // The CloudConfig data specified by the key may be plain-text, + // base64-encoded, or gzipped and base64-encoded. + // + // Please note this field and CloudConfig are mutually exclusive. + // + // +optional + RawCloudConfig *common.SecretKeySelector `json:"rawCloudConfig,omitempty"` + + // SSHAuthorizedKeys is a list of public keys that CloudInit will apply to + // the guest's default user. + // + // +optional + SSHAuthorizedKeys []string `json:"sshAuthorizedKeys,omitempty"` +} + +// VirtualMachineBootstrapLinuxPrepSpec describes the LinuxPrep configuration +// used to bootstrap the VM. +type VirtualMachineBootstrapLinuxPrepSpec struct { + // HardwareClockIsUTC specifies whether the hardware clock is in UTC or + // local time. + // + // +optional + HardwareClockIsUTC bool `json:"hardwareClockIsUTC,omitempty"` + + // TimeZone is a case-sensitive timezone, such as Europe/Sofia. + // + // Valid values are based on the tz (timezone) database used by Linux and + // other Unix systems. The values are strings in the form of + // "Area/Location," in which Area is a continent or ocean name, and + // Location is the city, island, or other regional designation. + // + // Please see https://kb.vmware.com/s/article/2145518 for a list of valid + // time zones for Linux systems. + // + // +optional + TimeZone string `json:"timeZone,omitempty"` +} + +// VirtualMachineBootstrapSysprepSpec describes the Sysprep configuration used +// to bootstrap the VM. +type VirtualMachineBootstrapSysprepSpec struct { + // Sysprep is an object representation of a Windows sysprep.xml answer file. + // + // This field encloses all the individual keys listed in a sysprep.xml file. + // + // For more detailed information please see + // https://technet.microsoft.com/en-us/library/cc771830(v=ws.10).aspx. + // + // Please note this field and RawSysprep are mutually exclusive. + // + // +optional + Sysprep *sysprep.Sysprep `json:"sysprep,omitempty"` + + // RawSysprep describes a key in a Secret resource that contains an XML + // string of the Sysprep text used to bootstrap the VM. + // + // The data specified by the Secret key may be plain-text, base64-encoded, + // or gzipped and base64-encoded. + // + // Please note this field and Sysprep are mutually exclusive. + // + // +optional + RawSysprep *common.SecretKeySelector `json:"rawSysprep,omitempty"` +} + +// VirtualMachineBootstrapVAppConfigSpec describes the vApp configuration +// used to bootstrap the VM. +type VirtualMachineBootstrapVAppConfigSpec struct { + // Properties is a list of vApp/OVF property key/value pairs. + // + // Please note this field and RawProperties are mutually exclusive. + // + // +optional + // +listType=map + // +listMapKey=key + Properties []common.KeyValueOrSecretKeySelectorPair `json:"properties,omitempty"` + + // RawProperties is the name of a Secret resource in the same Namespace as + // this VM where each key/value pair from the Secret is used as a vApp + // key/value pair. + // + // Please note this field and Properties are mutually exclusive. + // + // +optional + RawProperties string `json:"rawProperties,omitempty"` +} diff --git a/api/v1alpha3/virtualmachine_conversion.go b/api/v1alpha3/virtualmachine_conversion.go new file mode 100644 index 000000000..71baaff45 --- /dev/null +++ b/api/v1alpha3/virtualmachine_conversion.go @@ -0,0 +1,10 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +// Hub marks VirtualMachine as a conversion hub. +func (*VirtualMachine) Hub() {} + +// Hub marks VirtualMachineList as a conversion hub. +func (*VirtualMachineList) Hub() {} diff --git a/api/v1alpha3/virtualmachine_network_types.go b/api/v1alpha3/virtualmachine_network_types.go new file mode 100644 index 000000000..b433a0799 --- /dev/null +++ b/api/v1alpha3/virtualmachine_network_types.go @@ -0,0 +1,651 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" +) + +// VirtualMachineNetworkRouteSpec defines a static route for a guest. +type VirtualMachineNetworkRouteSpec struct { + // To is an IP4 or IP6 address. + To string `json:"to"` + + // Via is an IP4 or IP6 address. + Via string `json:"via"` + + // Metric is the weight/priority of the route. + Metric int32 `json:"metric"` +} + +// VirtualMachineNetworkInterfaceSpec describes the desired state of a VM's +// network interface. +type VirtualMachineNetworkInterfaceSpec struct { + // Name describes the unique name of this network interface, used to + // distinguish it from other network interfaces attached to this VM. + // + // When the bootstrap provider is Cloud-Init and GuestDeviceName is not + // specified, the device inside the guest will be renamed to this value. + // Please note it is up to the user to ensure the provided name does not + // conflict with any other devices inside the guest, ex. dvd, cdrom, sda, etc. + // + // +kubebuilder:validation:Pattern="^[a-z0-9]{2,}$" + Name string `json:"name"` + + // Network is the name of the network resource to which this interface is + // connected. + // + // If no network is provided, then this interface will be connected to the + // Namespace's default network. + // + // +optional + Network *common.PartialObjectRef `json:"network,omitempty"` + + // GuestDeviceName is used to rename the device inside the guest when the + // bootstrap provider is Cloud-Init. Please note it is up to the user to + // ensure the provided device name does not conflict with any other devices + // inside the guest, ex. dvd, cdrom, sda, etc. + // + // +optional + // +kubebuilder:validation:Pattern=^\w\w+$ + GuestDeviceName string `json:"guestDeviceName,omitempty"` + + // Addresses is an optional list of IP4 or IP6 addresses to assign to this + // interface. + // + // Please note this field is only supported if the connected network + // supports manual IP allocation. + // + // Please note IP4 and IP6 addresses must include the network prefix length, + // ex. 192.168.0.10/24 or 2001:db8:101::a/64. + // + // Please note this field may not contain IP4 addresses if DHCP4 is set + // to true or IP6 addresses if DHCP6 is set to true. + // + // Please note if the Interfaces field is non-empty then this field is + // ignored and should be specified on the elements in the Interfaces list. + // + // +optional + Addresses []string `json:"addresses,omitempty"` + + // DHCP4 indicates whether or not this interface uses DHCP for IP4 + // networking. + // + // Please note this field is only supported if the network connection + // supports DHCP. + // + // Please note this field is mutually exclusive with IP4 addresses in the + // Addresses field and the Gateway4 field. + // + // +optional + DHCP4 bool `json:"dhcp4,omitempty"` + + // DHCP6 indicates whether or not this interface uses DHCP for IP6 + // networking. + // + // Please note this field is only supported if the network connection + // supports DHCP. + // + // Please note this field is mutually exclusive with IP6 addresses in the + // Addresses field and the Gateway6 field. + // + // +optional + DHCP6 bool `json:"dhcp6,omitempty"` + + // Gateway4 is the default, IP4 gateway for this interface. + // + // Please note this field is only supported if the network connection + // supports manual IP allocation. + // + // If the network connection supports manual IP allocation and the + // Addresses field includes at least one IP4 address, then this field + // is required. + // + // Please note the IP address must include the network prefix length, ex. + // 192.168.0.1/24. + // + // Please note this field is mutually exclusive with DHCP4. + // + // +optional + Gateway4 string `json:"gateway4,omitempty"` + + // Gateway6 is the primary IP6 gateway for this interface. + // + // Please note this field is only supported if the network connection + // supports manual IP allocation. + // + // If the network connection supports manual IP allocation and the + // Addresses field includes at least one IP6 address, then this field + // is required. + // + // Please note the IP address must include the network prefix length, ex. + // 2001:db8:101::1/64. + // + // Please note this field is mutually exclusive with DHCP6. + // + // +optional + Gateway6 string `json:"gateway6,omitempty"` + + // MTU is the Maximum Transmission Unit size in bytes. + // + // Please note this feature is available only with the following bootstrap + // providers: CloudInit. + // + // +optional + MTU *int64 `json:"mtu,omitempty"` + + // Nameservers is a list of IP4 and/or IP6 addresses used as DNS + // nameservers. + // + // Please note this feature is available only with the following bootstrap + // providers: CloudInit and Sysprep. + // + // Please note that Linux allows only three nameservers + // (https://linux.die.net/man/5/resolv.conf). + // + // +optional + Nameservers []string `json:"nameservers,omitempty"` + + // Routes is a list of optional, static routes. + // + // Please note this feature is available only with the following bootstrap + // providers: CloudInit. + // + // +optional + Routes []VirtualMachineNetworkRouteSpec `json:"routes,omitempty"` + + // SearchDomains is a list of search domains used when resolving IP + // addresses with DNS. + // + // Please note this feature is available only with the following bootstrap + // providers: CloudInit. + // + // +optional + SearchDomains []string `json:"searchDomains,omitempty"` +} + +// VirtualMachineNetworkSpec defines a VM's desired network configuration. +type VirtualMachineNetworkSpec struct { + // HostName is the value the guest uses as its host name. + // If omitted then the name of the VM will be used. + // + // Please note this feature is available only with the following bootstrap + // providers: CloudInit, LinuxPrep, and Sysprep (except for RawSysprep). + // + // When the bootstrap provider is Sysprep (except for RawSysprep) this is + // used as the Computer Name. + // + // +optional + HostName string `json:"hostName,omitempty"` + + // Disabled is a flag that indicates whether or not to disable networking + // for this VM. + // + // When set to true, the VM is not configured with a default interface nor + // any specified from the Interfaces field. + // + // +optional + Disabled bool `json:"disabled,omitempty"` + + // Nameservers is a list of IP4 and/or IP6 addresses used as DNS + // nameservers. These are applied globally. + // + // Please note global nameservers are only available with the following + // bootstrap providers: LinuxPrep and Sysprep. The Cloud-Init bootstrap + // provider supports per-interface nameservers. + // + // Please note that Linux allows only three nameservers + // (https://linux.die.net/man/5/resolv.conf). + // + // +optional + Nameservers []string `json:"nameservers,omitempty"` + + // SearchDomains is a list of search domains used when resolving IP + // addresses with DNS. These are applied globally. + // + // Please note global search domains are only available with the following + // bootstrap providers: LinuxPrep and Sysprep. The Cloud-Init bootstrap + // provider supports per-interface search domains. + // + // +optional + SearchDomains []string `json:"searchDomains,omitempty"` + + // Interfaces is the list of network interfaces used by this VM. + // + // If the Interfaces field is empty and the Disabled field is false, then + // a default interface with the name eth0 will be created. + // + // The maximum number of network interface allowed is 10 because of the limit + // built into vSphere. + // + // +optional + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MaxItems=10 + Interfaces []VirtualMachineNetworkInterfaceSpec `json:"interfaces,omitempty"` +} + +// VirtualMachineNetworkDNSStatus describes the observed state of the guest's +// RFC 1034 client-side DNS settings. +type VirtualMachineNetworkDNSStatus struct { + // DHCP indicates whether or not dynamic host control protocol (DHCP) was + // used to configure DNS configuration. + // + // +optional + DHCP bool `json:"dhcp,omitempty"` + + // DomainName is the domain name portion of the DNS name. For example, + // the "domain.local" part of "my-vm.domain.local". + // + // +optional + DomainName string `json:"domainName,omitempty"` + + // HostName is the host name portion of the DNS name. For example, + // the "my-vm" part of "my-vm.domain.local". + // + // +optional + HostName string `json:"hostName,omitempty"` + + // Nameservers is a list of the IP addresses for the DNS servers to use. + // + // IP4 addresses are specified using dotted decimal notation. For example, + // "192.0.2.1". + // + // IP6 addresses are 128-bit addresses represented as eight fields of up to + // four hexadecimal digits. A colon separates each field (:). For example, + // 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of the + // symbol '::' to represent multiple 16-bit groups of contiguous 0's only + // once in an address as described in RFC 2373. + // + // +optional + Nameservers []string `json:"nameservers,omitempty"` + + // SearchDomains is a list of domains in which to search for hosts, in the + // order of preference. + // + // +optional + SearchDomains []string `json:"searchDomains,omitempty"` +} + +// VirtualMachineNetworkConfigDNSStatus describes the configured state of the +// RFC 1034 client-side DNS settings. +type VirtualMachineNetworkConfigDNSStatus struct { + // HostName is the host name portion of the DNS name. For example, + // the "my-vm" part of "my-vm.domain.local". + // + // +optional + HostName string `json:"hostName,omitempty"` + + // Nameservers is a list of the IP addresses for the DNS servers to use. + // + // IP4 addresses are specified using dotted decimal notation. For example, + // "192.0.2.1". + // + // IP6 addresses are 128-bit addresses represented as eight fields of up to + // four hexadecimal digits. A colon separates each field (:). For example, + // 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of the + // symbol '::' to represent multiple 16-bit groups of contiguous 0's only + // once in an address as described in RFC 2373. + // + // +optional + Nameservers []string `json:"nameservers,omitempty"` + + // SearchDomains is a list of domains in which to search for hosts, in the + // order of preference. + // + // +optional + SearchDomains []string `json:"searchDomains,omitempty"` +} + +// VirtualMachineNetworkDHCPOptionsStatus describes the observed state of +// DHCP options. +type VirtualMachineNetworkDHCPOptionsStatus struct { + // Config describes platform-dependent settings for the DHCP client. + // + // The key part is a unique number while the value part is the platform + // specific configuration command. For example on Linux and BSD systems + // using the file dhclient.conf output would be reported at system scope: + // key='1', value='timeout 60;' key='2', value='reboot 10;'. The output + // reported per interface would be: + // key='1', value='prepend domain-name-servers 192.0.2.1;' + // key='2', value='require subnet-mask, domain-name-servers;'. + // + // +optional + // +listType=map + // +listMapKey=key + Config []common.KeyValuePair `json:"config,omitempty"` + + // Enabled reports the status of the DHCP client services. + // +omitempty + Enabled bool `json:"enabled,omitempty"` +} + +// VirtualMachineNetworkConfigDHCPOptionsStatus describes the configured +// DHCP options. +type VirtualMachineNetworkConfigDHCPOptionsStatus struct { + // Enabled describes whether DHCP is enabled. + // +omitempty + Enabled bool `json:"enabled,omitempty"` +} + +// VirtualMachineNetworkDHCPStatus describes the observed state of the +// client-side, system-wide DHCP settings for IP4 and IP6. +type VirtualMachineNetworkDHCPStatus struct { + + // IP4 describes the observed state of the IP4 DHCP client settings. + // + // +optional + IP4 VirtualMachineNetworkDHCPOptionsStatus `json:"ip4,omitempty"` + + // IP6 describes the observed state of the IP6 DHCP client settings. + // + // +optional + IP6 VirtualMachineNetworkDHCPOptionsStatus `json:"ip6,omitempty"` +} + +// VirtualMachineNetworkConfigDHCPStatus describes the configured state of the +// system-wide DHCP settings for IP4 and IP6. +type VirtualMachineNetworkConfigDHCPStatus struct { + + // IP4 describes the configured state of the IP4 DHCP settings. + // + // +optional + IP4 *VirtualMachineNetworkConfigDHCPOptionsStatus `json:"ip4,omitempty"` + + // IP6 describes the configured state of the IP6 DHCP settings. + // + // +optional + IP6 *VirtualMachineNetworkConfigDHCPOptionsStatus `json:"ip6,omitempty"` +} + +// VirtualMachineNetworkIPRouteGatewayStatus describes the observed state of +// a guest network's IP route's next hop gateway. +type VirtualMachineNetworkIPRouteGatewayStatus struct { + // Device is the name of the device in the guest for which this gateway + // applies. + // + // +optional + Device string `json:"device,omitempty"` + + // Address is the IP4 or IP6 address of the gateway. + // + // +optional + Address string `json:"address,omitempty"` +} + +// VirtualMachineNetworkIPRouteStatus describes the observed state of a +// guest network's IP routes. +type VirtualMachineNetworkIPRouteStatus struct { + // Gateway describes where to send the packets to next. + Gateway VirtualMachineNetworkIPRouteGatewayStatus `json:"gateway"` + + // NetworkAddress is the IP4 or IP6 address of the destination network. + // + // Addresses include the network's prefix length, ex. 192.168.0.0/24 or + // 2001:DB8:101::230:6eff:fe04:d9ff::/64. + // + // IP6 addresses are 128-bit addresses represented as eight fields of up to + // four hexadecimal digits. A colon separates each field (:). For example, + // 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of symbol + // '::' to represent multiple 16-bit groups of contiguous 0's only once in + // an address as described in RFC 2373. + NetworkAddress string `json:"networkAddress"` +} + +// VirtualMachineNetworkRouteStatus describes the observed state of a +// guest network's routes. +type VirtualMachineNetworkRouteStatus struct { + // IPRoutes contain the VM's routing tables for all address families. + // + // +optional + IPRoutes []VirtualMachineNetworkIPRouteStatus `json:"ipRoutes,omitempty"` +} + +// VirtualMachineNetworkInterfaceIPAddrStatus describes information about a +// specific IP address. +type VirtualMachineNetworkInterfaceIPAddrStatus struct { + // Address is an IP4 or IP6 address and their network prefix length. + // + // An IP4 address is specified using dotted decimal notation. For example, + // "192.0.2.1". + // + // IP6 addresses are 128-bit addresses represented as eight fields of up to + // four hexadecimal digits. A colon separates each field (:). For example, + // 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of the + // symbol '::' to represent multiple 16-bit groups of contiguous 0's only + // once in an address as described in RFC 2373. + Address string `json:"address"` + + // Lifetime describes when this address will expire. + // + // +optional + Lifetime metav1.Time `json:"lifetime,omitempty"` + + // Origin describes how this address was configured. + // + // +optional + // +kubebuilder:validation:Enum=dhcp;linklayer;manual;other;random + Origin string `json:"origin,omitempty"` + + // State describes the state of this IP address. + // + // +optional + // +kubebuilder:validation:Enum=deprecated;duplicate;inaccessible;invalid;preferred;tentative;unknown + State string `json:"state,omitempty"` +} + +// VirtualMachineNetworkInterfaceIPStatus describes the observed state of a +// VM's network interface's IP configuration. +type VirtualMachineNetworkInterfaceIPStatus struct { + // AutoConfigurationEnabled describes whether or not ICMPv6 router + // solicitation requests are enabled or disabled from a given interface. + // + // These requests acquire an IP6 address and default gateway route from + // zero-to-many routers on the connected network. + // + // If not set then ICMPv6 is not available on this VM. + // + // +optional + AutoConfigurationEnabled *bool `json:"autoConfigurationEnabled,omitempty"` + + // DHCP describes the VM's observed, client-side, interface-specific DHCP + // options. + // + // +optional + DHCP *VirtualMachineNetworkDHCPStatus `json:"dhcp,omitempty"` + + // Addresses describes observed IP addresses for this interface. + // + // +optional + Addresses []VirtualMachineNetworkInterfaceIPAddrStatus `json:"addresses,omitempty"` + + // MACAddr describes the observed MAC address for this interface. + // + // +optional + MACAddr string `json:"macAddr,omitempty"` +} + +// VirtualMachineNetworkConfigInterfaceIPStatus describes the configured state +// of a VM's network interface's IP configuration. +type VirtualMachineNetworkConfigInterfaceIPStatus struct { + // DHCP describes the interface's configured DHCP options. + // + // +optional + DHCP *VirtualMachineNetworkConfigDHCPStatus `json:"dhcp,omitempty"` + + // Addresses describes configured IP addresses for this interface. + // Addresses include the network's prefix length, ex. 192.168.0.0/24 or + // 2001:DB8:101::230:6eff:fe04:d9ff::/64. + // + // +optional + Addresses []string `json:"addresses,omitempty"` + + // Gateway4 describes the interface's configured, default, IP4 gateway. + // + // Please note the IP address include the network prefix length, ex. + // 192.168.0.1/24. + // + // +optional + Gateway4 string `json:"gateway4,omitempty"` + + // Gateway6 describes the interface's configured, default, IP6 gateway. + // + // Please note the IP address includes the network prefix length, ex. + // 2001:db8:101::1/64. + // + // +optional + Gateway6 string `json:"gateway6,omitempty"` +} + +// VirtualMachineNetworkInterfaceStatus describes the observed state of a +// VM's network interface. +type VirtualMachineNetworkInterfaceStatus struct { + // Name describes the corresponding network interface with the same name + // in the VM's desired network interface list. If unset, then there is no + // corresponding entry for this interface. + // + // Please note this name is not necessarily related to the name of the + // device as it is surfaced inside of the guest. + // + // +optional + Name string `json:"name,omitempty"` + + // DeviceKey describes the unique hardware device key of this network + // interface. + // + // +optional + DeviceKey int32 `json:"deviceKey,omitempty"` + + // IP describes the observed state of the interface's IP configuration. + // + // +optional + IP *VirtualMachineNetworkInterfaceIPStatus `json:"ip,omitempty"` + + // DNS describes the observed state of the interface's DNS configuration. + // + // +optional + DNS *VirtualMachineNetworkDNSStatus `json:"dns,omitempty"` +} + +// VirtualMachineNetworkConfigInterfaceStatus describes the configured state of +// network interface. +type VirtualMachineNetworkConfigInterfaceStatus struct { + // Name describes the corresponding network interface with the same name + // in the VM's desired network interface list. + // + // Please note this name is not necessarily related to the name of the + // device as it is surfaced inside of the guest. + Name string `json:"name"` + + // IP describes the interface's configured IP information. + // + // +optional + IP *VirtualMachineNetworkConfigInterfaceIPStatus `json:"ip,omitempty"` + + // DNS describes the interface's configured DNS information. + // + // +optional + DNS *VirtualMachineNetworkConfigDNSStatus `json:"dns,omitempty"` +} + +// VirtualMachineNetworkIPStackStatus describes the observed state of a +// VM's IP stack. +type VirtualMachineNetworkIPStackStatus struct { + // DHCP describes the VM's observed, client-side, system-wide DHCP options. + // + // +optional + DHCP *VirtualMachineNetworkDHCPStatus `json:"dhcp,omitempty"` + + // DNS describes the VM's observed, client-side DNS configuration. + // + // +optional + DNS *VirtualMachineNetworkDNSStatus `json:"dns,omitempty"` + + // IPRoutes contain the VM's routing tables for all address families. + // + // +optional + IPRoutes []VirtualMachineNetworkIPRouteStatus `json:"ipRoutes,omitempty"` + + // KernelConfig describes the observed state of the VM's kernel IP + // configuration settings. + // + // The key part contains a unique number while the value part contains the + // 'key=value' as provided by the underlying provider. For example, on + // Linux and/or BSD, the systcl -a output would be reported as: + // key='5', value='net.ipv4.tcp_keepalive_time = 7200'. + // + // +optional + // +listType=map + // +listMapKey=key + KernelConfig []common.KeyValuePair `json:"kernelConfig,omitempty"` +} + +// VirtualMachineNetworkStatus defines the observed state of a VM's +// network configuration. +type VirtualMachineNetworkStatus struct { + // Config describes the resolved, configured network settings for the VM, + // such as an interface's IP address obtained from IPAM, or global DNS + // settings. + // + // Please note this information does *not* represent the *observed* network + // state of the VM, but is intended for situations where someone boots a VM + // with no appropriate bootstrap engine and needs to know the network config + // valid for the deployed VM. + // + // +optional + Config *VirtualMachineNetworkConfigStatus `json:"config,omitempty"` + + // Interfaces describes the status of the VM's network interfaces. + // + // +optional + Interfaces []VirtualMachineNetworkInterfaceStatus `json:"interfaces,omitempty"` + + // IPStacks describes information about the guest's configured IP networking + // stacks. + // + // +optional + IPStacks []VirtualMachineNetworkIPStackStatus `json:"ipStacks,omitempty"` + + // PrimaryIP4 describes the VM's primary IP4 address. + // + // If the bootstrap provider is CloudInit then this value is set to the + // value of the VM's "guestinfo.local-ipv4" property. Please see + // https://bit.ly/3NJB534 for more information on how this value is + // calculated. + // + // If the bootstrap provider is anything else then this field is set to the + // value of the infrastructure VM's "guest.ipAddress" field. Please see + // https://bit.ly/3Au0jM4 for more information. + // + // +optional + PrimaryIP4 string `json:"primaryIP4,omitempty"` + + // PrimaryIP6 describes the VM's primary IP6 address. + // + // If the bootstrap provider is CloudInit then this value is set to the + // value of the VM's "guestinfo.local-ipv6" property. Please see + // https://bit.ly/3NJB534 for more information on how this value is + // calculated. + // + // If the bootstrap provider is anything else then this field is set to the + // value of the infrastructure VM's "guest.ipAddress" field. Please see + // https://bit.ly/3Au0jM4 for more information. + // + // +optional + PrimaryIP6 string `json:"primaryIP6,omitempty"` +} + +type VirtualMachineNetworkConfigStatus struct { + // Interfaces describes the configured state of the network interfaces. + // + // +optional + Interfaces []VirtualMachineNetworkConfigInterfaceStatus `json:"interfaces,omitempty"` + + // DNS describes the configured state of client-side DNS. + // + // +optional + DNS *VirtualMachineNetworkConfigDNSStatus `json:"dns,omitempty"` +} diff --git a/api/v1alpha3/virtualmachine_readiness_types.go b/api/v1alpha3/virtualmachine_readiness_types.go new file mode 100644 index 000000000..408554639 --- /dev/null +++ b/api/v1alpha3/virtualmachine_readiness_types.go @@ -0,0 +1,127 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ( + "k8s.io/apimachinery/pkg/util/intstr" +) + +// VirtualMachineReadinessProbeSpec describes a probe used to determine if a VM +// is in a ready state. All probe actions are mutually exclusive. +type VirtualMachineReadinessProbeSpec struct { + // TCPSocket specifies an action involving a TCP port. + // + // Deprecated: The TCPSocket action requires network connectivity that is not supported in all environments. + // This field will be removed in a later API version. + // +optional + TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty"` + + // GuestHeartbeat specifies an action involving the guest heartbeat status. + // +optional + GuestHeartbeat *GuestHeartbeatAction `json:"guestHeartbeat,omitempty"` + + // GuestInfo specifies an action involving key/value pairs from GuestInfo. + // + // The elements are evaluated with the logical AND operator, meaning + // all expressions must evaluate as true for the probe to succeed. + // + // For example, a VM resource's probe definition could be specified as the + // following: + // + // guestInfo: + // - key: ready + // value: true + // + // With the above configuration in place, the VM would not be considered + // ready until the GuestInfo key "ready" was set to the value "true". + // + // From within the guest operating system it is possible to set GuestInfo + // key/value pairs using the program "vmware-rpctool," which is included + // with VM Tools. For example, the following command will set the key + // "guestinfo.ready" to the value "true": + // + // vmware-rpctool "info-set guestinfo.ready true" + // + // Once executed, the VM's readiness probe will be signaled and the + // VM resource will be marked as ready. + // + // +optional + GuestInfo []GuestInfoAction `json:"guestInfo,omitempty"` + + // TimeoutSeconds specifies a number of seconds after which the probe times out. + // Defaults to 10 seconds. Minimum value is 1. + // +optional + // +kubebuilder:validation:Minimum:=1 + // +kubebuilder:validation:Maximum:=60 + TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"` + + // PeriodSeconds specifics how often (in seconds) to perform the probe. + // Defaults to 10 seconds. Minimum value is 1. + // +optional + // +kubebuilder:validation:Minimum:=1 + PeriodSeconds int32 `json:"periodSeconds,omitempty"` +} + +// TCPSocketAction describes an action based on opening a socket. +type TCPSocketAction struct { + // Port specifies a number or name of the port to access on the VM. + // If the format of port is a number, it must be in the range 1 to 65535. + // If the format of name is a string, it must be an IANA_SVC_NAME. + Port intstr.IntOrString `json:"port"` + + // Host is an optional host name to connect to. Host defaults to the VM IP. + // +optional + Host string `json:"host,omitempty"` +} + +// GuestHeartbeatStatus is the guest heartbeat status. +type GuestHeartbeatStatus string + +// See govmomi.vim25.types.ManagedEntityStatus +const ( + // GrayHeartbeatStatus means VMware Tools are not installed or not running. + GrayHeartbeatStatus GuestHeartbeatStatus = "gray" + // RedHeartbeatStatus means no heartbeat. + // Guest operating system may have stopped responding. + RedHeartbeatStatus GuestHeartbeatStatus = "red" + // YellowHeartbeatStatus means an intermittent heartbeat. + // This may be due to guest load. + YellowHeartbeatStatus GuestHeartbeatStatus = "yellow" + // GreenHeartbeatStatus means the guest operating system is responding normally. + GreenHeartbeatStatus GuestHeartbeatStatus = "green" +) + +// GuestHeartbeatAction describes an action based on the guest heartbeat. +type GuestHeartbeatAction struct { + // ThresholdStatus is the value that the guest heartbeat status must be at or above to be + // considered successful. + // +kubebuilder:validation:Optional + // +kubebuilder:default=green + // +kubebuilder:validation:Enum=yellow;green + ThresholdStatus GuestHeartbeatStatus `json:"thresholdStatus,omitempty"` +} + +// GuestInfoAction describes a key from GuestInfo that must match the associated +// value expression. +type GuestInfoAction struct { + // Key is the name of the GuestInfo key. + // + // The key is automatically prefixed with "guestinfo." before being + // evaluated. Thus if the key "guestinfo.mykey" is provided, it will be + // evaluated as "guestinfo.guestinfo.mykey". + Key string `json:"key"` + + // Value is a regular expression that is matched against the value of the + // specified key. + // + // An empty value is the equivalent of "match any" or ".*". + // + // All values must adhere to the RE2 regular expression syntax as documented + // at https://golang.org/s/re2syntax. Invalid values may be rejected or + // ignored depending on the implementation of this API. Either way, invalid + // values will not be considered when evaluating the ready state of a VM. + // + // +optional + Value string `json:"value,omitempty"` +} diff --git a/api/v1alpha3/virtualmachine_storage_types.go b/api/v1alpha3/virtualmachine_storage_types.go new file mode 100644 index 000000000..899ceacca --- /dev/null +++ b/api/v1alpha3/virtualmachine_storage_types.go @@ -0,0 +1,88 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ( + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" +) + +// VirtualMachineVolumeProvisioningMode is the type used to express the +// desired or observed provisioning mode for a virtual machine disk. +// +// +kubebuilder:validation:Enum=Thin;Thick;ThickEagerZero +type VirtualMachineVolumeProvisioningMode string + +const ( + VirtualMachineVolumeProvisioningModeThin VirtualMachineVolumeProvisioningMode = "Thin" + VirtualMachineVolumeProvisioningModeThick VirtualMachineVolumeProvisioningMode = "Thick" + VirtualMachineVolumeProvisioningModeThickEagerZero VirtualMachineVolumeProvisioningMode = "ThickEagerZero" +) + +// VirtualMachineVolume represents a named volume in a VM. +type VirtualMachineVolume struct { + // Name represents the volume's name. Must be a DNS_LABEL and unique within + // the VM. + Name string `json:"name"` + + // VirtualMachineVolumeSource represents the location and type of a volume + // to mount. + VirtualMachineVolumeSource `json:",inline"` +} + +// VirtualMachineVolumeSource represents the source location of a volume to +// mount. Only one of its members may be specified. +type VirtualMachineVolumeSource struct { + // PersistentVolumeClaim represents a reference to a PersistentVolumeClaim + // in the same namespace. + // + // More information is available at + // https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims. + // + // +optional + PersistentVolumeClaim *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty"` +} + +// PersistentVolumeClaimVolumeSource is a composite for the Kubernetes +// corev1.PersistentVolumeClaimVolumeSource and instance storage options. +type PersistentVolumeClaimVolumeSource struct { + corev1.PersistentVolumeClaimVolumeSource `json:",inline" yaml:",inline"` + + // InstanceVolumeClaim is set if the PVC is backed by instance storage. + // +optional + InstanceVolumeClaim *InstanceVolumeClaimVolumeSource `json:"instanceVolumeClaim,omitempty"` +} + +// InstanceVolumeClaimVolumeSource contains information about the instance +// storage volume claimed as a PVC. +type InstanceVolumeClaimVolumeSource struct { + // StorageClass is the name of the Kubernetes StorageClass that provides + // the backing storage for this instance storage volume. + StorageClass string `json:"storageClass"` + + // Size is the size of the requested instance storage volume. + Size resource.Quantity `json:"size"` +} + +// VirtualMachineVolumeStatus defines the observed state of a +// VirtualMachineVolume instance. +type VirtualMachineVolumeStatus struct { + // Name is the name of the attached volume. + Name string `json:"name"` + + // Attached represents whether a volume has been successfully attached to + // the VirtualMachine or not. + // +optional + Attached bool `json:"attached,omitempty"` + + // DiskUUID represents the underlying virtual disk UUID and is present when + // attachment succeeds. + // +optional + DiskUUID string `json:"diskUUID,omitempty"` + + // Error represents the last error seen when attaching or detaching a + // volume. Error will be empty if attachment succeeds. + // +optional + Error string `json:"error,omitempty"` +} diff --git a/api/v1alpha3/virtualmachine_types.go b/api/v1alpha3/virtualmachine_types.go new file mode 100644 index 000000000..c89668f26 --- /dev/null +++ b/api/v1alpha3/virtualmachine_types.go @@ -0,0 +1,583 @@ +// Copyright (c) 2024-2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ( + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" +) + +const ( + // VirtualMachineConditionClassReady indicates that a referenced + // VirtualMachineClass is ready. + // + // For more information please see VirtualMachineClass.Status.Ready. + VirtualMachineConditionClassReady = "VirtualMachineClassReady" + + // VirtualMachineConditionImageReady indicates that a referenced + // VirtualMachineImage is ready. + // + // For more information please see VirtualMachineImage.Status.Ready. + VirtualMachineConditionImageReady = "VirtualMachineImageReady" + + // VirtualMachineConditionVMSetResourcePolicyReady indicates that a referenced + // VirtualMachineSetResourcePolicy is Ready. + VirtualMachineConditionVMSetResourcePolicyReady = "VirtualMachineConditionVMSetResourcePolicyReady" + + // VirtualMachineConditionStorageReady indicates that the storage prerequisites for the VM are ready. + VirtualMachineConditionStorageReady = "VirtualMachineStorageReady" + + // VirtualMachineConditionBootstrapReady indicates that the bootstrap prerequisites for the VM are ready. + VirtualMachineConditionBootstrapReady = "VirtualMachineBootstrapReady" + + // VirtualMachineConditionNetworkReady indicates that the network prerequisites for the VM are ready. + VirtualMachineConditionNetworkReady = "VirtualMachineNetworkReady" + + // VirtualMachineConditionPlacementReady indicates that the placement decision for the VM is ready. + VirtualMachineConditionPlacementReady = "VirtualMachineConditionPlacementReady" + + // VirtualMachineConditionCreated indicates that the VM has been created. + VirtualMachineConditionCreated = "VirtualMachineCreated" +) + +const ( + // GuestBootstrapCondition exposes the status of guest bootstrap from within + // the guest OS, when available. + GuestBootstrapCondition = "GuestBootstrap" +) + +const ( + // GuestCustomizationCondition exposes the status of guest customization + // from within the guest OS, when available. + GuestCustomizationCondition = "GuestCustomization" + + // GuestCustomizationIdleReason documents that guest + // customizations were not applied for the VirtualMachine. + GuestCustomizationIdleReason = "GuestCustomizationIdle" + + // GuestCustomizationPendingReason documents that guest + // customization is still pending within the guest OS. + GuestCustomizationPendingReason = "GuestCustomizationPending" + + // GuestCustomizationRunningReason documents that the guest + // customization is now running on the guest OS. + GuestCustomizationRunningReason = "GuestCustomizationRunning" + + // GuestCustomizationSucceededReason documents that the + // guest customization succeeded within the guest OS. + GuestCustomizationSucceededReason = "GuestCustomizationSucceeded" + + // GuestCustomizationFailedReason documents that the guest + // customization failed within the guest OS. + GuestCustomizationFailedReason = "GuestCustomizationFailed" +) + +const ( + // VirtualMachineToolsCondition exposes the status of VMware Tools running + // in the guest OS, when available. + VirtualMachineToolsCondition = "VirtualMachineTools" + + // VirtualMachineToolsNotRunningReason documents that + // VMware Tools is not running. + VirtualMachineToolsNotRunningReason = "VirtualMachineToolsNotRunning" + + // VirtualMachineToolsRunningReason documents that VMware + // Tools is running. + VirtualMachineToolsRunningReason = "VirtualMachineToolsRunning" +) + +const ( + // VirtualMachineReconcileReady exposes the status of VirtualMachine reconciliation. + VirtualMachineReconcileReady = "VirtualMachineReconcileReady" + + // VirtualMachineReconcileRunningReason indicates that VirtualMachine + // reconciliation is running. + VirtualMachineReconcileRunningReason = "VirtualMachineReconcileRunning" + + // VirtualMachineReconcilePausedReason indicates that VirtualMachine + // reconciliation is being paused. + VirtualMachineReconcilePausedReason = "VirtualMachineReconcilePaused" +) + +const ( + // PauseAnnotation is an annotation that prevents a VM from being + // reconciled. + // + // This can be used when a VM needs to be modified directly on the + // underlying infrastructure without VM Service attempting to direct the + // VM back to its intended state. + // + // The VM will not be reconciled again until this annotation is removed. + PauseAnnotation = GroupName + "/pause-reconcile" + + // InstanceIDAnnotation is an annotation that can be applied to set Cloud-Init metadata Instance ID. + // + // This cannot be set by users. It is for VM Operator to handle corner cases. + // + // In a corner case where a VM first boot failed to bootstrap with Cloud-Init, VM Operator sets Instance ID + // the same with the first boot Instance ID to prevent Cloud-Init from treating this VM as first boot + // due to different Instance ID. This annotation is used in upgrade script. + InstanceIDAnnotation = GroupName + "/cloud-init-instance-id" + + // FirstBootDoneAnnotation is an annotation that indicates the VM has been + // booted at least once. This annotation cannot be set by users and will not + // be removed once set until the VM is deleted. + FirstBootDoneAnnotation = "virtualmachine." + GroupName + "/first-boot-done" +) + +const ( + // ManagedByExtensionKey and ManagedByExtensionType represent the ManagedBy + // field on the VM. They are used to differentiate VM Service managed VMs + // from traditional vSphere VMs. + ManagedByExtensionKey = "com.vmware.vcenter.wcp" + ManagedByExtensionType = "VirtualMachine" +) + +// VirtualMachine backup/restore related constants. +const ( + // VMResourceYAMLExtraConfigKey is the ExtraConfig key to persist VM + // Kubernetes resource YAML, compressed using gzip and base64-encoded. + VMResourceYAMLExtraConfigKey = "vmservice.virtualmachine.resource.yaml" + // AdditionalResourcesYAMLExtraConfigKey is the ExtraConfig key to persist + // VM-relevant Kubernetes resource YAML, compressed using gzip and base64-encoded. + AdditionalResourcesYAMLExtraConfigKey = "vmservice.virtualmachine.additional.resources.yaml" + // PVCDiskDataExtraConfigKey is the ExtraConfig key to persist the VM's + // PVC disk data in JSON, compressed using gzip and base64-encoded. + PVCDiskDataExtraConfigKey = "vmservice.virtualmachine.pvc.disk.data" +) + +const ( + // PauseVMExtraConfigKey is the ExtraConfig key to allow override + // operations for admins to pause reconciliation of VM Service VM. + PauseVMExtraConfigKey = "vmservice.virtualmachine.pause" + + // PausedVMLabelKey is the label key to identify VMs that reconciliation + // are paused. Value will specify whose operation is responsible for + // the pause. It can be admins or devops or both. + // + // Only privileged user can edit this label. + PausedVMLabelKey = GroupName + "/paused" +) + +// VirtualMachinePowerState defines a VM's desired and observed power states. +// +kubebuilder:validation:Enum=PoweredOff;PoweredOn;Suspended +type VirtualMachinePowerState string + +const ( + // VirtualMachinePowerStateOff indicates to shut down a VM and/or it is + // shut down. + VirtualMachinePowerStateOff VirtualMachinePowerState = "PoweredOff" + + // VirtualMachinePowerStateOn indicates to power on a VM and/or it is + // powered on. + VirtualMachinePowerStateOn VirtualMachinePowerState = "PoweredOn" + + // VirtualMachinePowerStateSuspended indicates to suspend a VM and/or it is + // suspended. + VirtualMachinePowerStateSuspended VirtualMachinePowerState = "Suspended" +) + +// VirtualMachinePowerOpMode represents the various power operation modes when +// powering off or suspending a VM. +// +kubebuilder:validation:Enum=Hard;Soft;TrySoft +type VirtualMachinePowerOpMode string + +const ( + // VirtualMachinePowerOpModeHard indicates to halt a VM when powering it + // off or when suspending a VM to not involve the guest. + VirtualMachinePowerOpModeHard VirtualMachinePowerOpMode = "Hard" + + // VirtualMachinePowerOpModeSoft indicates to ask VM Tools running + // inside of a VM's guest to shutdown the guest gracefully when powering + // off a VM or when suspending a VM to allow the guest to participate. + // + // If this mode is set on a VM whose guest does not have VM Tools or if + // VM Tools is present but the operation fails, the VM may never realize + // the desired power state. This can prevent a VM from being deleted as well + // as many other unexpected issues. It is recommended to use trySoft + // instead. + VirtualMachinePowerOpModeSoft VirtualMachinePowerOpMode = "Soft" + + // VirtualMachinePowerOpModeTrySoft indicates to first attempt a Soft + // operation and fall back to Hard if VM Tools is not present in the guest, + // if the Soft operation fails, or if the VM is not in the desired power + // state within five minutes. + VirtualMachinePowerOpModeTrySoft VirtualMachinePowerOpMode = "TrySoft" +) + +// VirtualMachineSpec defines the desired state of a VirtualMachine. +type VirtualMachineSpec struct { + // ImageName describes the name of the image resource used to deploy this + // VM. + // + // This field may be used to specify the name of a VirtualMachineImage + // or ClusterVirtualMachineImage resource. The resolver first checks to see + // if there is a VirtualMachineImage with the specified name. If no + // such resource exists, the resolver then checks to see if there is a + // ClusterVirtualMachineImage resource with the specified name in the same + // Namespace as the VM being deployed. + // + // This field may also be used to specify the display name (vSphere name) of + // a VirtualMachineImage or ClusterVirtualMachineImage resource. If the + // display name unambiguously resolves to a distinct VM image (among all + // existing VirtualMachineImages in the VM's namespace and all existing + // ClusterVirtualMachineImages), then a mutation webhook updates this field + // with the VM image resource name. If the display name resolves to multiple + // or no VM images, then the mutation webhook denies the request and outputs + // an error message accordingly. + // + // +optional + ImageName string `json:"imageName,omitempty"` + + // ClassName describes the name of the VirtualMachineClass resource used to + // deploy this VM. + // + // +optional + ClassName string `json:"className,omitempty"` + + // StorageClass describes the name of a Kubernetes StorageClass resource + // used to configure this VM's storage-related attributes. + // + // Please see https://kubernetes.io/docs/concepts/storage/storage-classes/ + // for more information on Kubernetes storage classes. + // + // +optional + StorageClass string `json:"storageClass,omitempty"` + + // Bootstrap describes the desired state of the guest's bootstrap + // configuration. + // + // If omitted, a default bootstrap method may be selected based on the + // guest OS identifier. If Linux, then the LinuxPrep method is used. + // + // +optional + Bootstrap *VirtualMachineBootstrapSpec `json:"bootstrap,omitempty"` + + // Network describes the desired network configuration for the VM. + // + // Please note this value may be omitted entirely and the VM will be + // assigned a single, virtual network interface that is connected to the + // Namespace's default network. + // + // +optional + Network *VirtualMachineNetworkSpec `json:"network,omitempty"` + + // PowerState describes the desired power state of a VirtualMachine. + // + // Please note this field may be omitted when creating a new VM and will + // default to "PoweredOn." However, once the field is set to a non-empty + // value, it may no longer be set to an empty value. + // + // Additionally, setting this value to "Suspended" is not supported when + // creating a new VM. The valid values when creating a new VM are + // "PoweredOn" and "PoweredOff." An empty value is also allowed on create + // since this value defaults to "PoweredOn" for new VMs. + // + // +optional + PowerState VirtualMachinePowerState `json:"powerState,omitempty"` + + // PowerOffMode describes the desired behavior when powering off a VM. + // + // There are three, supported power off modes: Hard, Soft, and + // TrySoft. The first mode, Hard, is the equivalent of a physical + // system's power cord being ripped from the wall. The Soft mode + // requires the VM's guest to have VM Tools installed and attempts to + // gracefully shutdown the VM. Its variant, TrySoft, first attempts + // a graceful shutdown, and if that fails or the VM is not in a powered off + // state after five minutes, the VM is halted. + // + // If omitted, the mode defaults to TrySoft. + // + // +optional + // +kubebuilder:default=TrySoft + PowerOffMode VirtualMachinePowerOpMode `json:"powerOffMode,omitempty"` + + // SuspendMode describes the desired behavior when suspending a VM. + // + // There are three, supported suspend modes: Hard, Soft, and + // TrySoft. The first mode, Hard, is where vSphere suspends the VM to + // disk without any interaction inside of the guest. The Soft mode + // requires the VM's guest to have VM Tools installed and attempts to + // gracefully suspend the VM. Its variant, TrySoft, first attempts + // a graceful suspend, and if that fails or the VM is not in a put into + // standby by the guest after five minutes, the VM is suspended. + // + // If omitted, the mode defaults to TrySoft. + // + // +optional + // +kubebuilder:default=TrySoft + SuspendMode VirtualMachinePowerOpMode `json:"suspendMode,omitempty"` + + // NextRestartTime may be used to restart the VM, in accordance with + // RestartMode, by setting the value of this field to "now" + // (case-insensitive). + // + // A mutating webhook changes this value to the current time (UTC), which + // the VM controller then uses to determine the VM should be restarted by + // comparing the value to the timestamp of the last time the VM was + // restarted. + // + // Please note it is not possible to schedule future restarts using this + // field. The only value that users may set is the string "now" + // (case-insensitive). + // + // +optional + NextRestartTime string `json:"nextRestartTime,omitempty"` + + // RestartMode describes the desired behavior for restarting a VM when + // spec.nextRestartTime is set to "now" (case-insensitive). + // + // There are three, supported suspend modes: Hard, Soft, and + // TrySoft. The first mode, Hard, is where vSphere resets the VM without any + // interaction inside of the guest. The Soft mode requires the VM's guest to + // have VM Tools installed and asks the guest to restart the VM. Its + // variant, TrySoft, first attempts a soft restart, and if that fails or + // does not complete within five minutes, the VM is hard reset. + // + // If omitted, the mode defaults to TrySoft. + // + // +optional + // +kubebuilder:default=TrySoft + RestartMode VirtualMachinePowerOpMode `json:"restartMode,omitempty"` + + // Volumes describes a list of volumes that can be mounted to the VM. + // + // +optional + // +listType=map + // +listMapKey=name + Volumes []VirtualMachineVolume `json:"volumes,omitempty"` + + // ReadinessProbe describes a probe used to determine the VM's ready state. + // + // +optional + ReadinessProbe *VirtualMachineReadinessProbeSpec `json:"readinessProbe,omitempty"` + + // Advanced describes a set of optional, advanced VM configuration options. + // +optional + Advanced *VirtualMachineAdvancedSpec `json:"advanced,omitempty"` + + // Reserved describes a set of VM configuration options reserved for system + // use. + // + // Please note attempts to modify the value of this field by a DevOps user + // will result in a validation error. + // + // +optional + Reserved *VirtualMachineReservedSpec `json:"reserved,omitempty"` + + // +optional + // +kubebuilder:validation:Minimum=13 + + // MinHardwareVersion describes the desired, minimum hardware version. + // + // The logic that determines the hardware version is as follows: + // + // 1. If this field is set, then its value is used. + // 2. Otherwise, if the VirtualMachineClass used to deploy the VM contains a + // non-empty hardware version, then it is used. + // 3. Finally, if the hardware version is still undetermined, the value is + // set to the default hardware version for the Datacenter/Cluster/Host + // where the VM is provisioned. + // + // This field is never updated to reflect the derived hardware version. + // Instead, VirtualMachineStatus.HardwareVersion surfaces + // the observed hardware version. + // + // Please note, setting this field's value to N ensures a VM's hardware + // version is equal to or greater than N. For example, if a VM's observed + // hardware version is 10 and this field's value is 13, then the VM will be + // upgraded to hardware version 13. However, if the observed hardware + // version is 17 and this field's value is 13, no change will occur. + // + // Several features are hardware version dependent, for example: + // + // * NVMe Controllers >= 14 + // * Dynamic Direct Path I/O devices >= 17 + // + // Please refer to https://kb.vmware.com/s/article/1003746 for a list of VM + // hardware versions. + // + // It is important to remember that a VM's hardware version may not be + // downgraded and upgrading a VM deployed from an image based on an older + // hardware version to a more recent one may result in unpredictable + // behavior. In other words, please be careful when choosing to upgrade a + // VM to a newer hardware version. + MinHardwareVersion int32 `json:"minHardwareVersion,omitempty"` +} + +// VirtualMachineReservedSpec describes a set of VM configuration options +// reserved for system use. Modification attempts by DevOps users will result +// in a validation error. +type VirtualMachineReservedSpec struct { + // ResourcePolicyName describes the name of a + // VirtualMachineSetResourcePolicy resource used to configure the VM's + // resource policy. + // + // +optional + ResourcePolicyName string `json:"resourcePolicyName,omitempty"` +} + +// VirtualMachineAdvancedSpec describes a set of optional, advanced VM +// configuration options. +type VirtualMachineAdvancedSpec struct { + // BootDiskCapacity is the capacity of the VM's boot disk -- the first disk + // from the VirtualMachineImage from which the VM was deployed. + // + // Please note it is not advised to change this value while the VM is + // running. Also, resizing the VM's boot disk may require actions inside of + // the guest to take advantage of the additional capacity. Finally, changing + // the size of the VM's boot disk, even increasing it, could adversely + // affect the VM. + // + // +optional + BootDiskCapacity *resource.Quantity `json:"bootDiskCapacity,omitempty"` + + // DefaultVolumeProvisioningMode specifies the default provisioning mode for + // persistent volumes managed by this VM. + // + // +optional + DefaultVolumeProvisioningMode VirtualMachineVolumeProvisioningMode `json:"defaultVolumeProvisioningMode,omitempty"` + + // ChangeBlockTracking is a flag that enables incremental backup support + // for this VM, a feature utilized by external backup systems such as + // VMware Data Recovery. + // + // +optional + ChangeBlockTracking bool `json:"changeBlockTracking,omitempty"` +} + +// VirtualMachineStatus defines the observed state of a VirtualMachine instance. +type VirtualMachineStatus struct { + // Image is a reference to the VirtualMachineImage resource used to deploy + // this VM. + // + // +optional + Image *common.LocalObjectRef `json:"image,omitempty"` + + // Class is a reference to the VirtualMachineClass resource used to deploy + // this VM. + // + // +optional + Class *common.LocalObjectRef `json:"class,omitempty"` + + // Host describes the hostname or IP address of the infrastructure host + // where the VM is executed. + // + // +optional + Host string `json:"host,omitempty"` + + // PowerState describes the observed power state of the VirtualMachine. + // +optional + PowerState VirtualMachinePowerState `json:"powerState,omitempty"` + + // Conditions describes the observed conditions of the VirtualMachine. + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty"` + + // Network describes the observed state of the VM's network configuration. + // Please note much of the network status information is only available if + // the guest has VM Tools installed. + // +optional + Network *VirtualMachineNetworkStatus `json:"network,omitempty"` + + // UniqueID describes a unique identifier that is provided by the underlying + // infrastructure provider, such as vSphere. + // + // +optional + UniqueID string `json:"uniqueID,omitempty"` + + // BiosUUID describes a unique identifier provided by the underlying + // infrastructure provider that is exposed to the Guest OS BIOS as a unique + // hardware identifier. + // + // +optional + BiosUUID string `json:"biosUUID,omitempty"` + + // InstanceUUID describes the unique instance UUID provided by the + // underlying infrastructure provider, such as vSphere. + // + // +optional + InstanceUUID string `json:"instanceUUID,omitempty"` + + // Volumes describes a list of current status information for each Volume + // that is desired to be attached to the VM. + // +optional + // +listType=map + // +listMapKey=name + Volumes []VirtualMachineVolumeStatus `json:"volumes,omitempty"` + + // ChangeBlockTracking describes the CBT enablement status on the VM. + // + // +optional + ChangeBlockTracking *bool `json:"changeBlockTracking,omitempty"` + + // Zone describes the availability zone where the VirtualMachine has been + // scheduled. + // + // Please note this field may be empty when the cluster is not zone-aware. + // + // +optional + Zone string `json:"zone,omitempty"` + + // LastRestartTime describes the last time the VM was restarted. + // + // +optional + LastRestartTime *metav1.Time `json:"lastRestartTime,omitempty"` + + // HardwareVersion describes the VirtualMachine resource's observed + // hardware version. + // + // Please refer to VirtualMachineSpec.MinHardwareVersion for more + // information on the topic of a VM's hardware version. + // + // +optional + HardwareVersion int32 `json:"hardwareVersion,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Namespaced,shortName=vm +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Power-State",type="string",JSONPath=".status.powerState" +// +kubebuilder:printcolumn:name="Class",type="string",priority=1,JSONPath=".spec.className" +// +kubebuilder:printcolumn:name="Image",type="string",priority=1,JSONPath=".spec.imageName" +// +kubebuilder:printcolumn:name="Primary-IP4",type="string",priority=1,JSONPath=".status.network.primaryIP4" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" + +// VirtualMachine is the schema for the virtualmachines API and represents the +// desired state and observed status of a virtualmachines resource. +type VirtualMachine struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec VirtualMachineSpec `json:"spec,omitempty"` + Status VirtualMachineStatus `json:"status,omitempty"` +} + +func (vm *VirtualMachine) NamespacedName() string { + return vm.Namespace + "/" + vm.Name +} + +func (vm *VirtualMachine) GetConditions() []metav1.Condition { + return vm.Status.Conditions +} + +func (vm *VirtualMachine) SetConditions(conditions []metav1.Condition) { + vm.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// VirtualMachineList contains a list of VirtualMachine. +type VirtualMachineList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VirtualMachine `json:"items"` +} + +func init() { + SchemeBuilder.Register(&VirtualMachine{}, &VirtualMachineList{}) +} diff --git a/api/v1alpha3/virtualmachine_webhook.go b/api/v1alpha3/virtualmachine_webhook.go new file mode 100644 index 000000000..6412dd4ba --- /dev/null +++ b/api/v1alpha3/virtualmachine_webhook.go @@ -0,0 +1,12 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ctrl "sigs.k8s.io/controller-runtime" + +func (r *VirtualMachine) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} diff --git a/api/v1alpha3/virtualmachineclass_conversion.go b/api/v1alpha3/virtualmachineclass_conversion.go new file mode 100644 index 000000000..3ae818f53 --- /dev/null +++ b/api/v1alpha3/virtualmachineclass_conversion.go @@ -0,0 +1,10 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +// Hub marks VirtualMachineClass as a conversion hub. +func (*VirtualMachineClass) Hub() {} + +// Hub marks VirtualMachineClassList as a conversion hub. +func (*VirtualMachineClassList) Hub() {} diff --git a/api/v1alpha3/virtualmachineclass_types.go b/api/v1alpha3/virtualmachineclass_types.go new file mode 100644 index 000000000..6ef7a2464 --- /dev/null +++ b/api/v1alpha3/virtualmachineclass_types.go @@ -0,0 +1,206 @@ +// Copyright (c) 2022 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ( + "encoding/json" + + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// VirtualMachineConfigSpec contains additional virtual machine +// configuration settings including hardware specifications for the +// VirtualMachine. +// +// We only support XML for now, but that may change in the future. +type VirtualMachineConfigSpec struct { + // XML contains a vim.vm.ConfigSpec object that has been serialized to XML + // and base64-encoded. + // + // +optional + XML string `json:"xml,omitempty"` +} + +// VGPUDevice contains the configuration corresponding to a vGPU device. +type VGPUDevice struct { + ProfileName string `json:"profileName"` +} + +// DynamicDirectPathIODevice contains the configuration corresponding to a +// Dynamic DirectPath I/O device. +type DynamicDirectPathIODevice struct { + VendorID int64 `json:"vendorID"` + DeviceID int64 `json:"deviceID"` + + // +optional + CustomLabel string `json:"customLabel,omitempty"` +} + +// InstanceStorage provides information used to configure instance +// storage volumes for a VirtualMachine. +type InstanceStorage struct { + // StorageClass refers to the name of a StorageClass resource used to + // provide the storage for the configured instance storage volumes. + // The value of this field has no relationship to or bearing on the field + // virtualMachine.spec.storageClass. Please note the referred StorageClass + // must be available in the same namespace as the VirtualMachineClass that + // uses it for configuring instance storage. + StorageClass string `json:"storageClass,omitempty"` + + // Volumes describes instance storage volumes created for a VirtualMachine + // instance that use this VirtualMachineClass. + Volumes []InstanceStorageVolume `json:"volumes,omitempty"` +} + +// InstanceStorageVolume contains information required to create an +// instance storage volume on a VirtualMachine. +type InstanceStorageVolume struct { + Size resource.Quantity `json:"size"` +} + +// VirtualDevices contains information about the virtual devices associated +// with a VirtualMachineClass. +type VirtualDevices struct { + // +optional + // +listType=map + // +listMapKey=profileName + VGPUDevices []VGPUDevice `json:"vgpuDevices,omitempty"` + + // +optional + DynamicDirectPathIODevices []DynamicDirectPathIODevice `json:"dynamicDirectPathIODevices,omitempty"` +} + +// VirtualMachineClassHardware describes a virtual hardware resource +// specification. +type VirtualMachineClassHardware struct { + // +optional + Cpus int64 `json:"cpus,omitempty"` + + // +optional + Memory resource.Quantity `json:"memory,omitempty"` + + // +optional + Devices VirtualDevices `json:"devices,omitempty"` + + // +optional + InstanceStorage InstanceStorage `json:"instanceStorage,omitempty"` +} + +// VirtualMachineResourceSpec describes a virtual hardware policy specification. +type VirtualMachineResourceSpec struct { + // +optional + Cpu resource.Quantity `json:"cpu,omitempty"` //nolint:stylecheck,revive + + // +optional + Memory resource.Quantity `json:"memory,omitempty"` +} + +// VirtualMachineClassResources describes the virtual hardware resource +// reservations and limits configuration to be used by a VirtualMachineClass. +type VirtualMachineClassResources struct { + // +optional + Requests VirtualMachineResourceSpec `json:"requests,omitempty"` + + // +optional + Limits VirtualMachineResourceSpec `json:"limits,omitempty"` +} + +// VirtualMachineClassPolicies describes the policy configuration to be used by +// a VirtualMachineClass. +type VirtualMachineClassPolicies struct { + Resources VirtualMachineClassResources `json:"resources,omitempty"` +} + +// VirtualMachineClassSpec defines the desired state of VirtualMachineClass. +type VirtualMachineClassSpec struct { + // ControllerName describes the name of the controller responsible for + // reconciling VirtualMachine resources that are realized from this + // VirtualMachineClass. + // + // When omitted, controllers reconciling VirtualMachine resources determine + // the default controller name from the environment variable + // DEFAULT_VM_CLASS_CONTROLLER_NAME. If this environment variable is not + // defined or empty, it defaults to vmoperator.vmware.com/vsphere. + // + // Once a non-empty value is assigned to this field, attempts to set this + // field to an empty value will be silently ignored. + // + // +optional + ControllerName string `json:"controllerName,omitempty"` + + // Hardware describes the configuration of the VirtualMachineClass + // attributes related to virtual hardware. The configuration specified in + // this field is used to customize the virtual hardware characteristics of + // any VirtualMachine associated with this VirtualMachineClass. + // + // +optional + Hardware VirtualMachineClassHardware `json:"hardware,omitempty"` + + // Policies describes the configuration of the VirtualMachineClass + // attributes related to virtual infrastructure policy. The configuration + // specified in this field is used to customize various policies related to + // infrastructure resource consumption. + // + // +optional + Policies VirtualMachineClassPolicies `json:"policies,omitempty"` + + // Description describes the configuration of the VirtualMachineClass which + // is not related to virtual hardware or infrastructure policy. This field + // is used to address remaining specs about this VirtualMachineClass. + // + // +optional + Description string `json:"description,omitempty"` + + // ConfigSpec describes additional configuration information for a + // VirtualMachine. + // The contents of this field are the VirtualMachineConfigSpec data object + // (https://bit.ly/3HDtiRu) marshaled to JSON using the discriminator + // field "_typeName" to preserve type information. + // + // +optional + // +kubebuilder:validation:Schemaless + // +kubebuilder:validation:Type=object + // +kubebuilder:pruning:PreserveUnknownFields + ConfigSpec json.RawMessage `json:"configSpec,omitempty"` +} + +// VirtualMachineClassStatus defines the observed state of VirtualMachineClass. +type VirtualMachineClassStatus struct { +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Namespaced,shortName=vmclass +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="CPU",type="string",JSONPath=".spec.hardware.cpus" +// +kubebuilder:printcolumn:name="Memory",type="string",JSONPath=".spec.hardware.memory" +// +kubebuilder:printcolumn:name="Capabilities",type="string",priority=1,JSONPath=".status.capabilities" + +// VirtualMachineClass is the schema for the virtualmachineclasses API and +// represents the desired state and observed status of a virtualmachineclasses +// resource. +type VirtualMachineClass struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec VirtualMachineClassSpec `json:"spec,omitempty"` + Status VirtualMachineClassStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// VirtualMachineClassList contains a list of VirtualMachineClass. +type VirtualMachineClassList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VirtualMachineClass `json:"items"` +} + +func init() { + SchemeBuilder.Register( + &VirtualMachineClass{}, + &VirtualMachineClassList{}, + ) +} diff --git a/api/v1alpha3/virtualmachineclass_webhook.go b/api/v1alpha3/virtualmachineclass_webhook.go new file mode 100644 index 000000000..16b165970 --- /dev/null +++ b/api/v1alpha3/virtualmachineclass_webhook.go @@ -0,0 +1,12 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ctrl "sigs.k8s.io/controller-runtime" + +func (r *VirtualMachineClass) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} diff --git a/api/v1alpha3/virtualmachineimage_conversion.go b/api/v1alpha3/virtualmachineimage_conversion.go new file mode 100644 index 000000000..6c77f75a1 --- /dev/null +++ b/api/v1alpha3/virtualmachineimage_conversion.go @@ -0,0 +1,16 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +// Hub marks VirtualMachineImage as a conversion hub. +func (*VirtualMachineImage) Hub() {} + +// Hub marks VirtualMachineImageList as a conversion hub. +func (*VirtualMachineImageList) Hub() {} + +// Hub marks ClusterVirtualMachineImage as a conversion hub. +func (*ClusterVirtualMachineImage) Hub() {} + +// Hub marks ClusterVirtualMachineImageList as a conversion hub. +func (*ClusterVirtualMachineImageList) Hub() {} diff --git a/api/v1alpha3/virtualmachineimage_types.go b/api/v1alpha3/virtualmachineimage_types.go new file mode 100644 index 000000000..556cdf0a2 --- /dev/null +++ b/api/v1alpha3/virtualmachineimage_types.go @@ -0,0 +1,296 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" +) + +const ( + imageOSLabelPrefix = "os.image." + GroupName + "/" + + // VirtualMachineImageOSIDLabel is a label applied to images with + // a value that specifies the operating system ID. + VirtualMachineImageOSIDLabel = imageOSLabelPrefix + "id" + + // VirtualMachineImageOSTypeLabel is a label applied to images with a + // value that specifies the operating system type. + VirtualMachineImageOSTypeLabel = imageOSLabelPrefix + "type" + + // VirtualMachineImageOSVersionLabel is a label applied to images with + // a value that specifies the operating system version. + VirtualMachineImageOSVersionLabel = imageOSLabelPrefix + "version" +) + +const ( + // VirtualMachineImageCapabilityLabel is the prefix for a label that + // advertises an image capability. + VirtualMachineImageCapabilityLabel = "capability.image." + GroupName + "/" +) + +const ( + // VMIContentLibRefAnnotation is the key for the annotation that stores the content library + // reference for VMI and CVMI down conversion. + VMIContentLibRefAnnotation = "vmoperator.vmware.com/conversion-content-lib-ref" +) + +const ( + // VirtualMachineImageV1Alpha1CompatibleCondition denotes that an image was prepared by + // VMware specifically for compatibility with VMService. + VirtualMachineImageV1Alpha1CompatibleCondition = "VirtualMachineImageV1Alpha1Compatible" +) + +// Condition reasons for VirtualMachineImages. +const ( + // VirtualMachineImageNotSyncedReason documents that the VirtualMachineImage is not synced with + // the vSphere content library item that contains the source of this image's information. + VirtualMachineImageNotSyncedReason = "VirtualMachineImageNotSynced" + + // VirtualMachineImageProviderNotReadyReason documents that the VirtualMachineImage provider + // is not in ready state. + VirtualMachineImageProviderNotReadyReason = "VirtualMachineImageProviderNotReady" + + // VirtualMachineImageProviderSecurityNotCompliantReason documents that the + // VirtualMachineImage provider doesn't meet security compliance requirements. + VirtualMachineImageProviderSecurityNotCompliantReason = "VirtualMachineImageProviderSecurityNotCompliant" +) + +// VirtualMachineImageProductInfo describes product information for an image. +type VirtualMachineImageProductInfo struct { + // Product is a general descriptor for the image. + // +optional + Product string `json:"product,omitempty"` + + // Vendor describes the organization/user that produced the image. + // +optional + Vendor string `json:"vendor,omitempty"` + + // Version describes the short-form version of the image. + // +optional + Version string `json:"version,omitempty"` + + // FullVersion describes the long-form version of the image. + // +optional + FullVersion string `json:"fullVersion,omitempty"` +} + +// VirtualMachineImageOSInfo describes the image's guest operating system. +type VirtualMachineImageOSInfo struct { + // ID describes the operating system ID. + // + // This value is also added to the image resource's labels as + // VirtualMachineImageOSIDLabel. + // + // +optional + ID string `json:"id,omitempty"` + + // Type describes the operating system type. + // + // This value is also added to the image resource's labels as + // VirtualMachineImageOSTypeLabel. + // + // +optional + Type string `json:"type,omitempty"` + + // Version describes the operating system version. + // + // This value is also added to the image resource's labels as + // VirtualMachineImageOSVersionLabel. + // + // +optional + Version string `json:"version,omitempty"` +} + +// 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. +type OVFProperty struct { + // Key describes the OVF property's key. + Key string `json:"key"` + + // Type describes the OVF property's type. + Type string `json:"type"` + + // Default describes the OVF property's default value. + // +optional + Default *string `json:"default,omitempty"` +} + +// VirtualMachineImageSpec defines the desired state of VirtualMachineImage. +type VirtualMachineImageSpec struct { + // ProviderRef is a reference to the resource that contains the source of + // this image's information. + // + // +optional + ProviderRef *common.LocalObjectRef `json:"providerRef,omitempty"` +} + +// VirtualMachineImageStatus defines the observed state of VirtualMachineImage. +type VirtualMachineImageStatus struct { + + // Name describes the display name of this image. + // + // +optional + Name string `json:"name,omitempty"` + + // Capabilities describes the image's observed capabilities. + // + // 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: + // + // * cloud-init + // * nvidia-gpu + // * sriov-net + // + // 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. + // + // +optional + // +listType=set + Capabilities []string `json:"capabilities,omitempty"` + + // Firmware describe the firmware type used by this image, ex. BIOS, EFI. + // +optional + Firmware string `json:"firmware,omitempty"` + + // HardwareVersion describes the observed hardware version of this image. + // + // +optional + HardwareVersion *int32 `json:"hardwareVersion,omitempty"` + + // OSInfo describes the observed operating system information for this + // image. + // + // The OS information is also added to the image resource's labels. Please + // refer to VirtualMachineImageOSInfo for more information. + // + // + // +optional + OSInfo VirtualMachineImageOSInfo `json:"osInfo,omitempty"` + + // OVFProperties describes the observed user configurable OVF properties defined for this + // image. + // + // +optional + OVFProperties []OVFProperty `json:"ovfProperties,omitempty"` + + // VMwareSystemProperties describes the observed VMware system properties defined for + // this image. + // + // +optional + VMwareSystemProperties []common.KeyValuePair `json:"vmwareSystemProperties,omitempty"` + + // ProductInfo describes the observed product information for this image. + // +optional + ProductInfo VirtualMachineImageProductInfo `json:"productInfo,omitempty"` + + // 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. + // +optional + ProviderContentVersion string `json:"providerContentVersion,omitempty"` + + // 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. + // +optional + ProviderItemID string `json:"providerItemID,omitempty"` + + // Conditions describes the observed conditions for this image. + // + // +optional + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Namespaced,shortName=vmi;vmimage +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Display Name",type="string",JSONPath=".status.name" +// +kubebuilder:printcolumn:name="Image Version",type="string",JSONPath=".status.productInfo.version" +// +kubebuilder:printcolumn:name="OS Name",type="string",JSONPath=".status.osInfo.type" +// +kubebuilder:printcolumn:name="OS Version",type="string",JSONPath=".status.osInfo.version" +// +kubebuilder:printcolumn:name="Hardware Version",type="string",JSONPath=".status.hardwareVersion" +// +kubebuilder:printcolumn:name="Capabilities",type="string",JSONPath=".status.capabilities" + +// VirtualMachineImage is the schema for the virtualmachineimages API. +type VirtualMachineImage struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec VirtualMachineImageSpec `json:"spec,omitempty"` + Status VirtualMachineImageStatus `json:"status,omitempty"` +} + +func (i *VirtualMachineImage) GetConditions() []metav1.Condition { + return i.Status.Conditions +} + +func (i *VirtualMachineImage) SetConditions(conditions []metav1.Condition) { + i.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// VirtualMachineImageList contains a list of VirtualMachineImage. +type VirtualMachineImageList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VirtualMachineImage `json:"items"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Cluster,shortName=cvmi;cvmimage;clustervmi;clustervmimage +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Display Name",type="string",JSONPath=".status.name" +// +kubebuilder:printcolumn:name="Image Version",type="string",JSONPath=".status.productInfo.version" +// +kubebuilder:printcolumn:name="OS Name",type="string",JSONPath=".status.osInfo.type" +// +kubebuilder:printcolumn:name="OS Version",type="string",JSONPath=".status.osInfo.version" +// +kubebuilder:printcolumn:name="Hardware Version",type="string",JSONPath=".status.hardwareVersion" + +// ClusterVirtualMachineImage is the schema for the clustervirtualmachineimages +// API. +type ClusterVirtualMachineImage struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec VirtualMachineImageSpec `json:"spec,omitempty"` + Status VirtualMachineImageStatus `json:"status,omitempty"` +} + +func (i *ClusterVirtualMachineImage) GetConditions() []metav1.Condition { + return i.Status.Conditions +} + +func (i *ClusterVirtualMachineImage) SetConditions(conditions []metav1.Condition) { + i.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// ClusterVirtualMachineImageList contains a list of ClusterVirtualMachineImage. +type ClusterVirtualMachineImageList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ClusterVirtualMachineImage `json:"items"` +} + +func init() { + SchemeBuilder.Register( + &VirtualMachineImage{}, + &VirtualMachineImageList{}, + &ClusterVirtualMachineImage{}, + &ClusterVirtualMachineImageList{}, + ) +} diff --git a/api/v1alpha3/virtualmachineimage_webhook.go b/api/v1alpha3/virtualmachineimage_webhook.go new file mode 100644 index 000000000..2367c1284 --- /dev/null +++ b/api/v1alpha3/virtualmachineimage_webhook.go @@ -0,0 +1,18 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ctrl "sigs.k8s.io/controller-runtime" + +func (r *VirtualMachineImage) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} + +func (r *ClusterVirtualMachineImage) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} diff --git a/api/v1alpha3/virtualmachinepublishrequest_conversion.go b/api/v1alpha3/virtualmachinepublishrequest_conversion.go new file mode 100644 index 000000000..3f8ea364f --- /dev/null +++ b/api/v1alpha3/virtualmachinepublishrequest_conversion.go @@ -0,0 +1,10 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +// Hub marks VirtualMachinePublishRequest as a conversion hub. +func (*VirtualMachinePublishRequest) Hub() {} + +// Hub marks VirtualMachinePublishRequestList as a conversion hub. +func (*VirtualMachinePublishRequestList) Hub() {} diff --git a/api/v1alpha3/virtualmachinepublishrequest_types.go b/api/v1alpha3/virtualmachinepublishrequest_types.go new file mode 100644 index 000000000..3a98783ba --- /dev/null +++ b/api/v1alpha3/virtualmachinepublishrequest_types.go @@ -0,0 +1,373 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + // VirtualMachinePublishRequestConditionSourceValid is the Type for a + // VirtualMachinePublishRequest resource's status condition. + // + // The condition's status is set to true only when the information + // that describes the source side of the publication has been validated. + VirtualMachinePublishRequestConditionSourceValid = "SourceValid" + + // VirtualMachinePublishRequestConditionTargetValid is the Type for a + // VirtualMachinePublishRequest resource's status condition. + // + // The condition's status is set to true only when the information + // that describes the target side of the publication has been + // validated. + VirtualMachinePublishRequestConditionTargetValid = "TargetValid" + + // VirtualMachinePublishRequestConditionUploaded is the Type for a + // VirtualMachinePublishRequest resource's status condition. + // + // The condition's status is set to true only when the VM being + // published has been successfully uploaded. + VirtualMachinePublishRequestConditionUploaded = "Uploaded" + + // VirtualMachinePublishRequestConditionImageAvailable is the Type for a + // VirtualMachinePublishRequest resource's status condition. + // + // The condition's status is set to true only when a new + // VirtualMachineImage resource has been realized from the published + // VM. + VirtualMachinePublishRequestConditionImageAvailable = "ImageAvailable" + + // VirtualMachinePublishRequestConditionComplete is the Type for a + // VirtualMachinePublishRequest resource's status condition. + // + // The condition's status is set to true only when all other conditions + // present on the resource have a truthy status. + VirtualMachinePublishRequestConditionComplete = "Complete" +) + +// Condition.Reason for Conditions related to VirtualMachinePublishRequest. +const ( + // SourceVirtualMachineNotExistReason documents that the source VM of + // the VirtualMachinePublishRequest doesn't exist. + SourceVirtualMachineNotExistReason = "SourceVirtualMachineNotExist" + + // SourceVirtualMachineNotCreatedReason documents that the source VM of + // the VirtualMachinePublishRequest hasn't been created. + SourceVirtualMachineNotCreatedReason = "SourceVirtualMachineNotCreated" + + // TargetContentLibraryNotExistReason documents that the target content + // library of the VirtualMachinePublishRequest doesn't exist. + TargetContentLibraryNotExistReason = "TargetContentLibraryNotExist" + + // TargetContentLibraryNotWritableReason documents that the target content + // library of the VirtualMachinePublishRequest isn't writable. + TargetContentLibraryNotWritableReason = "TargetContentLibraryNotWritable" + + // TargetContentLibraryNotReadyReason documents that the target content + // library of the VirtualMachinePublishRequest isn't ready. + TargetContentLibraryNotReadyReason = "TargetContentLibraryNotReady" + + // TargetItemAlreadyExistsReason documents that an item with the same name + // as the VirtualMachinePublishRequest's target item name exists in + // the target content library. + TargetItemAlreadyExistsReason = "TargetItemAlreadyExists" + + // TargetVirtualMachineImageNotFoundReason documents that the expected + // VirtualMachineImage resource corresponding to the VirtualMachinePublishRequest's + // target item is not found in the namespace. + TargetVirtualMachineImageNotFoundReason = "VirtualMachineImageNotFound" + + // UploadTaskNotStartedReason documents that the VM publish task hasn't started. + UploadTaskNotStartedReason = "NotStarted" + + // UploadTaskQueuedReason documents that the VM publish task is in queued status. + UploadTaskQueuedReason = "Queued" + + // UploadingReason documents that the VM publish task is in running status + // and the published item is being uploaded to the target location. + UploadingReason = "Uploading" + + // UploadItemIDInvalidReason documents that the VM publish task result + // returns an invalid Item id. + UploadItemIDInvalidReason = "ItemIDInvalid" + + // UploadFailureReason documents that uploading published item to the + // target location failed. + UploadFailureReason = "UploadFailure" + + // HasNotBeenUploadedReason documents that the VirtualMachinePublishRequest + // hasn't completed because the published item hasn't been uploaded + // to the target location. + HasNotBeenUploadedReason = "HasNotBeenUploaded" + + // ImageUnavailableReason documents that the VirtualMachinePublishRequest + // hasn't been completed because the expected VirtualMachineImage resource + // isn't available yet. + ImageUnavailableReason = "ImageUnavailable" +) + +// VirtualMachinePublishRequestSource is the source of a publication request, +// typically a VirtualMachine resource. +type VirtualMachinePublishRequestSource struct { + // Name is the name of the referenced object. + // + // If omitted this value defaults to the name of the + // VirtualMachinePublishRequest resource. + // + // +optional + Name string `json:"name,omitempty"` + + // APIVersion is the API version of the referenced object. + // + // +kubebuilder:default=vmoperator.vmware.com/v1alpha1 + // +optional + APIVersion string `json:"apiVersion,omitempty"` + + // Kind is the kind of referenced object. + // + // +kubebuilder:default=VirtualMachine + // +optional + Kind string `json:"kind,omitempty"` +} + +// VirtualMachinePublishRequestTargetItem is the item part of a +// publication request's target. +type VirtualMachinePublishRequestTargetItem struct { + // Name is the name of the published object. + // + // 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. + // + // If omitted then the controller will use spec.source.name + "-image". + // + // +optional + Name string `json:"name,omitempty"` + + // Description is the description to assign to the published object. + // + // +optional + Description string `json:"description,omitempty"` +} + +// VirtualMachinePublishRequestTargetLocation is the location part of a +// publication request's target. +type VirtualMachinePublishRequestTargetLocation struct { + // Name is the name of the referenced object. + // + // Please note an error will be returned if this field is not + // set in a namespace that lacks a default publication target. + // + // A default publication target is a resource with an API version + // equal to spec.target.location.apiVersion, a kind equal to + // spec.target.location.kind, and has the label + // "imageregistry.vmware.com/default". + // + // +optional + Name string `json:"name,omitempty"` + + // APIVersion is the API version of the referenced object. + // + // +kubebuilder:default=imageregistry.vmware.com/v1alpha1 + // +optional + APIVersion string `json:"apiVersion,omitempty"` + + // Kind is the kind of referenced object. + // + // +kubebuilder:default=ContentLibrary + // +optional + Kind string `json:"kind,omitempty"` +} + +// VirtualMachinePublishRequestTarget is the target of a publication request, +// typically a ContentLibrary resource. +type VirtualMachinePublishRequestTarget struct { + // Item contains information about the name of the object to which + // the VM is published. + // + // Please note this value is optional and if omitted, the controller + // will use spec.source.name + "-image" as the name of the published + // item. + // + // +optional + Item VirtualMachinePublishRequestTargetItem `json:"item,omitempty"` + + // Location contains information about the location to which to publish + // the VM. + // + // +optional + Location VirtualMachinePublishRequestTargetLocation `json:"location,omitempty"` +} + +// VirtualMachinePublishRequestSpec defines the desired state of a +// VirtualMachinePublishRequest. +// +// All the fields in this spec are optional. This is especially useful when a +// DevOps persona wants to publish a VM without doing anything more than +// applying a VirtualMachinePublishRequest resource that has the same name +// as said VM in the same namespace as said VM. +type VirtualMachinePublishRequestSpec struct { + // Source is the source of the publication request, ex. a VirtualMachine + // resource. + // + // If this value is omitted then the publication controller checks to + // see if there is a resource with the same name as this + // VirtualMachinePublishRequest resource, an API version equal to + // spec.source.apiVersion, and a kind equal to spec.source.kind. If such + // a resource exists, then it is the source of the publication. + // + // +optional + Source VirtualMachinePublishRequestSource `json:"source,omitempty"` + + // Target is the target of the publication request, ex. item + // information and a ContentLibrary resource. + // + // If this value is omitted, the controller uses spec.source.name + "-image" + // as the name of the published item. Additionally, when omitted the + // controller attempts to identify the target location by matching a + // resource with an API version equal to spec.target.location.apiVersion, a + // kind equal to spec.target.location.kind, w/ the label + // "imageregistry.vmware.com/default". + // + // Please note that while optional, if a VirtualMachinePublishRequest sans + // target information is applied to a namespace without a default + // publication target, then the VirtualMachinePublishRequest resource + // will be marked in error. + // + // +optional + Target VirtualMachinePublishRequestTarget `json:"target,omitempty"` + + // TTLSecondsAfterFinished is the time-to-live duration for how long this + // resource will be allowed to exist once the publication operation + // completes. After the TTL expires, the resource will be automatically + // deleted without the user having to take any direct action. + // + // If this field is unset then the request resource will not be + // automatically deleted. If this field is set to zero then the request + // resource is eligible for deletion immediately after it finishes. + // + // +optional + // +kubebuilder:validation:Minimum=0 + TTLSecondsAfterFinished *int64 `json:"ttlSecondsAfterFinished,omitempty"` +} + +// VirtualMachinePublishRequestStatus defines the observed state of a +// VirtualMachinePublishRequest. +type VirtualMachinePublishRequestStatus struct { + // SourceRef is the reference to the source of the publication request, + // ex. a VirtualMachine resource. + // + // +optional + SourceRef *VirtualMachinePublishRequestSource `json:"sourceRef,omitempty"` + + // TargetRef is the reference to the target of the publication request, + // ex. item information and a ContentLibrary resource. + // + // + // +optional + TargetRef *VirtualMachinePublishRequestTarget `json:"targetRef,omitempty"` + + // CompletionTime represents time when the request was completed. It is not + // guaranteed to be set in happens-before order across separate operations. + // It is represented in RFC3339 form and is in UTC. + // + // The value of this field should be equal to the value of the + // LastTransitionTime for the status condition Type=Complete. + // + // +optional + CompletionTime metav1.Time `json:"completionTime,omitempty"` + + // StartTime represents time when the request was acknowledged by the + // controller. It is not guaranteed to be set in happens-before order + // across separate operations. It is represented in RFC3339 form and is + // in UTC. + // + // +optional + StartTime metav1.Time `json:"startTime,omitempty"` + + // Attempts represents the number of times the request to publish the VM + // has been attempted. + // + // +optional + Attempts int64 `json:"attempts,omitempty"` + + // LastAttemptTime represents the time when the latest request was sent. + // + // +optional + LastAttemptTime metav1.Time `json:"lastAttemptTime,omitempty"` + + // ImageName is the name of the VirtualMachineImage resource that is + // eventually realized in the same namespace as the VM and publication + // request after the publication operation completes. + // + // This field will not be set until the VirtualMachineImage resource + // is realized. + // + // +optional + ImageName string `json:"imageName,omitempty"` + + // Ready is set to true only when the VM has been published successfully + // and the new VirtualMachineImage resource is ready. + // + // Readiness is determined by waiting until there is status condition + // Type=Complete and ensuring it and all other status conditions present + // have a Status=True. The conditions present will be: + // + // * SourceValid + // * TargetValid + // * Uploaded + // * ImageAvailable + // * Complete + // + // +optional + Ready bool `json:"ready,omitempty"` + + // Conditions is a list of the latest, available observations of the + // request's current state. + // + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Namespaced,shortName=vmpub +// +kubebuilder:storageversion +// +kubebuilder:subresource:status + +// VirtualMachinePublishRequest defines the information necessary to publish a +// VirtualMachine as a VirtualMachineImage to an image registry. +type VirtualMachinePublishRequest struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec VirtualMachinePublishRequestSpec `json:"spec,omitempty"` + Status VirtualMachinePublishRequestStatus `json:"status,omitempty"` +} + +func (vmpub *VirtualMachinePublishRequest) GetConditions() []metav1.Condition { + return vmpub.Status.Conditions +} + +func (vmpub *VirtualMachinePublishRequest) SetConditions(conditions []metav1.Condition) { + vmpub.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// VirtualMachinePublishRequestList contains a list of +// VirtualMachinePublishRequest resources. +type VirtualMachinePublishRequestList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VirtualMachinePublishRequest `json:"items"` +} + +func init() { + SchemeBuilder.Register( + &VirtualMachinePublishRequest{}, + &VirtualMachinePublishRequestList{}, + ) +} diff --git a/api/v1alpha3/virtualmachinepublishrequest_webhook.go b/api/v1alpha3/virtualmachinepublishrequest_webhook.go new file mode 100644 index 000000000..ea019cf34 --- /dev/null +++ b/api/v1alpha3/virtualmachinepublishrequest_webhook.go @@ -0,0 +1,12 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ctrl "sigs.k8s.io/controller-runtime" + +func (r *VirtualMachinePublishRequest) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} diff --git a/api/v1alpha3/virtualmachineservice_conversion.go b/api/v1alpha3/virtualmachineservice_conversion.go new file mode 100644 index 000000000..9b7e4a0ca --- /dev/null +++ b/api/v1alpha3/virtualmachineservice_conversion.go @@ -0,0 +1,10 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +// Hub marks VirtualMachineService as a conversion hub. +func (*VirtualMachineService) Hub() {} + +// Hub marks VirtualMachineServiceList as a conversion hub. +func (*VirtualMachineServiceList) Hub() {} diff --git a/api/v1alpha3/virtualmachineservice_types.go b/api/v1alpha3/virtualmachineservice_types.go new file mode 100644 index 000000000..9d8e62004 --- /dev/null +++ b/api/v1alpha3/virtualmachineservice_types.go @@ -0,0 +1,177 @@ +// Copyright (c) 2022 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// VirtualMachineServiceType string describes ingress methods for a service. +type VirtualMachineServiceType string + +// These types correspond to a subset of the core Service Types. +const ( + // VirtualMachineServiceTypeClusterIP means a service will only be + // accessible inside the cluster, via the cluster IP. + VirtualMachineServiceTypeClusterIP VirtualMachineServiceType = "ClusterIP" + + // VirtualMachineServiceTypeLoadBalancer means a service will be exposed via + // an external load balancer (if the cloud provider supports it), in + // addition to 'NodePort' type. + VirtualMachineServiceTypeLoadBalancer VirtualMachineServiceType = "LoadBalancer" + + // VirtualMachineServiceTypeExternalName means a service consists of only a + // reference to an external name that kubedns or equivalent will return as a + // CNAME record, with no exposing or proxying of any VirtualMachines + // involved. + VirtualMachineServiceTypeExternalName VirtualMachineServiceType = "ExternalName" +) + +// VirtualMachineServicePort describes the specification of a service port to +// be exposed by a VirtualMachineService. This VirtualMachineServicePort +// specification includes attributes that define the external and internal +// representation of the service port. +type VirtualMachineServicePort struct { + // Name describes the name to be used to identify this + // VirtualMachineServicePort. + Name string `json:"name"` + + // Protocol describes the Layer 4 transport protocol for this port. + // Supports "TCP", "UDP", and "SCTP". + Protocol string `json:"protocol"` + + // Port describes the external port that will be exposed by the service. + Port int32 `json:"port"` + + // TargetPort describes the internal port open on a VirtualMachine that + // should be mapped to the external Port. + TargetPort int32 `json:"targetPort"` +} + +// LoadBalancerStatus represents the status of a load balancer. +type LoadBalancerStatus struct { + // Ingress is a list containing ingress addresses for the load balancer. + // Traffic intended for the service should be sent to any of these ingress + // points. + // +optional + Ingress []LoadBalancerIngress `json:"ingress,omitempty"` +} + +// LoadBalancerIngress represents the status of a load balancer ingress point: +// traffic intended for the service should be sent to an ingress point. +// IP or Hostname may both be set in this structure. It is up to the consumer to +// determine which field should be used when accessing this LoadBalancer. +type LoadBalancerIngress struct { + // IP is set for load balancer ingress points that are specified by an IP + // address. + // +optional + IP string `json:"ip,omitempty"` + + // Hostname is set for load balancer ingress points that are specified by a + // DNS address. + // +optional + Hostname string `json:"hostname,omitempty"` +} + +// VirtualMachineServiceSpec defines the desired state of VirtualMachineService. +type VirtualMachineServiceSpec struct { + // Type specifies a desired VirtualMachineServiceType for this + // VirtualMachineService. Supported types are ClusterIP, LoadBalancer, + // ExternalName. + Type VirtualMachineServiceType `json:"type"` + + // Ports specifies a list of VirtualMachineServicePort to expose with this + // VirtualMachineService. Each of these ports will be an accessible network + // entry point to access this service by. + Ports []VirtualMachineServicePort `json:"ports,omitempty"` + + // Selector specifies a map of key-value pairs, also known as a Label + // Selector, that is used to match this VirtualMachineService with the set + // of VirtualMachines that should back this VirtualMachineService. + // +optional + Selector map[string]string `json:"selector,omitempty"` + + // Only applies to VirtualMachineService Type: LoadBalancer + // LoadBalancer will get created with the IP specified in this field. + // This feature depends on whether the underlying load balancer provider + // supports specifying the loadBalancerIP when a load balancer is created. + // This field will be ignored if the provider does not support the feature. + // Deprecated: This field was under-specified and its meaning varies across implementations. + // Using it is non-portable and it may not support dual-stack. + // Users are encouraged to use implementation-specific annotations when available. + // +optional + LoadBalancerIP string `json:"loadBalancerIP,omitempty"` + + // LoadBalancerSourceRanges is an array of IP addresses in the format of + // CIDRs, for example: 103.21.244.0/22 and 10.0.0.0/24. + // If specified and supported by the load balancer provider, this will + // restrict ingress traffic to the specified client IPs. This field will be + // ignored if the provider does not support the feature. + // +optional + LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"` + + // clusterIP is the IP address of the service and is usually assigned + // randomly by the master. If an address is specified manually and is not in + // use by others, it will be allocated to the service; otherwise, creation + // of the service will fail. This field can not be changed through updates. + // Valid values are "None", empty string (""), or a valid IP address. "None" + // can be specified for headless services when proxying is not required. + // Only applies to types ClusterIP and LoadBalancer. + // Ignored if type is ExternalName. + // More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies + // +optional + ClusterIP string `json:"clusterIp,omitempty"` + + // externalName is the external reference that kubedns or equivalent will + // return as a CNAME record for this service. No proxying will be involved. + // Must be a valid RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + // and requires Type to be ExternalName. + // +optional + ExternalName string `json:"externalName,omitempty"` +} + +// VirtualMachineServiceStatus defines the observed state of +// VirtualMachineService. +type VirtualMachineServiceStatus struct { + // LoadBalancer contains the current status of the load balancer, + // if one is present. + // +optional + LoadBalancer LoadBalancerStatus `json:"loadBalancer,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:shortName=vmservice +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".spec.type" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" + +// VirtualMachineService is the Schema for the virtualmachineservices API. +type VirtualMachineService struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec VirtualMachineServiceSpec `json:"spec,omitempty"` + Status VirtualMachineServiceStatus `json:"status,omitempty"` +} + +func (s *VirtualMachineService) NamespacedName() string { + return s.Namespace + "/" + s.Name +} + +// +kubebuilder:object:root=true + +// VirtualMachineServiceList contains a list of VirtualMachineService. +type VirtualMachineServiceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VirtualMachineService `json:"items"` +} + +func init() { + SchemeBuilder.Register( + &VirtualMachineService{}, + &VirtualMachineServiceList{}, + ) +} diff --git a/api/v1alpha3/virtualmachineservice_webhook.go b/api/v1alpha3/virtualmachineservice_webhook.go new file mode 100644 index 000000000..c62f09b85 --- /dev/null +++ b/api/v1alpha3/virtualmachineservice_webhook.go @@ -0,0 +1,12 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ctrl "sigs.k8s.io/controller-runtime" + +func (r *VirtualMachineService) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} diff --git a/api/v1alpha3/virtualmachinesetresourcepolicy_conversion.go b/api/v1alpha3/virtualmachinesetresourcepolicy_conversion.go new file mode 100644 index 000000000..5ce3e6357 --- /dev/null +++ b/api/v1alpha3/virtualmachinesetresourcepolicy_conversion.go @@ -0,0 +1,10 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +// Hub marks VirtualMachineSetResourcePolicy as a conversion hub. +func (*VirtualMachineSetResourcePolicy) Hub() {} + +// Hub marks VirtualMachineSetResourcePolicy as a conversion hub. +func (*VirtualMachineSetResourcePolicyList) Hub() {} diff --git a/api/v1alpha3/virtualmachinesetresourcepolicy_types.go b/api/v1alpha3/virtualmachinesetresourcepolicy_types.go new file mode 100644 index 000000000..38c1a3db9 --- /dev/null +++ b/api/v1alpha3/virtualmachinesetresourcepolicy_types.go @@ -0,0 +1,77 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ResourcePoolSpec defines a Logical Grouping of workloads that share resource +// policies. +type ResourcePoolSpec struct { + // Name describes the name of the ResourcePool grouping. + // +optional + Name string `json:"name,omitempty"` + + // Reservations describes the guaranteed resources reserved for the + // ResourcePool. + // +optional + Reservations VirtualMachineResourceSpec `json:"reservations,omitempty"` + + // Limits describes the limit to resources available to the ResourcePool. + // +optional + Limits VirtualMachineResourceSpec `json:"limits,omitempty"` +} + +// VirtualMachineSetResourcePolicySpec defines the desired state of +// VirtualMachineSetResourcePolicy. +type VirtualMachineSetResourcePolicySpec struct { + ResourcePool ResourcePoolSpec `json:"resourcePool,omitempty"` + Folder string `json:"folder,omitempty"` + ClusterModuleGroups []string `json:"clusterModuleGroups,omitempty"` +} + +// VirtualMachineSetResourcePolicyStatus defines the observed state of +// VirtualMachineSetResourcePolicy. +type VirtualMachineSetResourcePolicyStatus struct { + ClusterModules []VSphereClusterModuleStatus `json:"clustermodules,omitempty"` +} + +// VSphereClusterModuleStatus describes the observed state of a vSphere +// cluster module. +type VSphereClusterModuleStatus struct { + GroupName string `json:"groupName"` + ModuleUuid string `json:"moduleUUID"` //nolint:revive,stylecheck + ClusterMoID string `json:"clusterMoID"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:storageversion +// +kubebuilder:subresource:status + +// VirtualMachineSetResourcePolicy is the Schema for the virtualmachinesetresourcepolicies API. +type VirtualMachineSetResourcePolicy struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec VirtualMachineSetResourcePolicySpec `json:"spec,omitempty"` + Status VirtualMachineSetResourcePolicyStatus `json:"status,omitempty"` +} + +func (p *VirtualMachineSetResourcePolicy) NamespacedName() string { + return p.Namespace + "/" + p.Name +} + +// +kubebuilder:object:root=true + +// VirtualMachineSetResourcePolicyList contains a list of VirtualMachineSetResourcePolicy. +type VirtualMachineSetResourcePolicyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VirtualMachineSetResourcePolicy `json:"items"` +} + +func init() { + SchemeBuilder.Register(&VirtualMachineSetResourcePolicy{}, &VirtualMachineSetResourcePolicyList{}) +} diff --git a/api/v1alpha3/virtualmachinesetresourcepolicy_webhook.go b/api/v1alpha3/virtualmachinesetresourcepolicy_webhook.go new file mode 100644 index 000000000..739114e29 --- /dev/null +++ b/api/v1alpha3/virtualmachinesetresourcepolicy_webhook.go @@ -0,0 +1,12 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ctrl "sigs.k8s.io/controller-runtime" + +func (r *VirtualMachineSetResourcePolicy) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} diff --git a/api/v1alpha3/virtualmachinetempl_types.go b/api/v1alpha3/virtualmachinetempl_types.go new file mode 100644 index 000000000..a8159b356 --- /dev/null +++ b/api/v1alpha3/virtualmachinetempl_types.go @@ -0,0 +1,50 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +// NetworkDeviceStatus defines the network interface IP configuration including +// gateway, subnet mask and IP address as seen by OVF properties. +type NetworkDeviceStatus struct { + // Gateway4 is the gateway for the IPv4 address family for this device. + // +optional + Gateway4 string + + // MacAddress is the MAC address of the network device. + // +optional + MacAddress string + + // IpAddresses represents one or more IP addresses assigned to the network + // device in CIDR notation, ex. "192.0.2.1/16". + // +optional + IPAddresses []string +} + +// NetworkStatus describes the observed state of the VM's network configuration. +type NetworkStatus struct { + // Devices describe a list of current status information for each + // network interface that is desired to be attached to the + // VirtualMachineTemplate. + // +optional + Devices []NetworkDeviceStatus + + // Nameservers describe a list of the DNS servers accessible by one of the + // VM's configured network devices. + // +optional + Nameservers []string +} + +// VirtualMachineTemplate defines the specification for configuring +// VirtualMachine Template. A Virtual Machine Template is created during VM +// customization to populate OVF properties. Then by utilizing Golang-based +// templating, Virtual Machine Template provides access to dynamic configuration +// data. +type VirtualMachineTemplate struct { + // Net describes the observed state of the VM's network configuration. + // +optional + Net NetworkStatus + + // VM represents a pointer to a VirtualMachine instance that consist of the + // desired specification and the observed status + VM *VirtualMachine +} diff --git a/api/v1alpha3/virtualmachinewebconsolerequest_conversion.go b/api/v1alpha3/virtualmachinewebconsolerequest_conversion.go new file mode 100644 index 000000000..10466122e --- /dev/null +++ b/api/v1alpha3/virtualmachinewebconsolerequest_conversion.go @@ -0,0 +1,10 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +// Hub marks VirtualMachineWebConsoleRequest as a conversion hub. +func (*VirtualMachineWebConsoleRequest) Hub() {} + +// Hub marks VirtualMachineWebConsoleRequestList as a conversion hub. +func (*VirtualMachineWebConsoleRequestList) Hub() {} diff --git a/api/v1alpha3/virtualmachinewebconsolerequest_types.go b/api/v1alpha3/virtualmachinewebconsolerequest_types.go new file mode 100644 index 000000000..48adfb2ce --- /dev/null +++ b/api/v1alpha3/virtualmachinewebconsolerequest_types.go @@ -0,0 +1,85 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// VirtualMachineWebConsoleRequestSpec describes the desired state for a web +// console request to a VM. +type VirtualMachineWebConsoleRequestSpec struct { + // Name is the name of a VM in the same Namespace as this web console + // request. + Name string `json:"name"` + // PublicKey is used to encrypt the status.response. This is expected to be a RSA OAEP public key in X.509 PEM format. + PublicKey string `json:"publicKey"` +} + +// VirtualMachineWebConsoleRequestStatus describes the observed state of the +// request. +type VirtualMachineWebConsoleRequestStatus struct { + // Response will be the authenticated ticket corresponding to this web console request. + Response string `json:"response,omitempty"` + // ExpiryTime is the time at which access via this request will expire. + ExpiryTime metav1.Time `json:"expiryTime,omitempty"` + + // ProxyAddr describes the host address and optional port used to access + // the VM's web console. + // + // The value could be a DNS entry, IPv4, or IPv6 address, followed by an + // optional port. For example, valid values include: + // + // DNS + // * host.com + // * host.com:6443 + // + // IPv4 + // * 1.2.3.4 + // * 1.2.3.4:6443 + // + // IPv6 + // * 1234:1234:1234:1234:1234:1234:1234:1234 + // * [1234:1234:1234:1234:1234:1234:1234:1234]:6443 + // * 1234:1234:1234:0000:0000:0000:1234:1234 + // * 1234:1234:1234::::1234:1234 + // * [1234:1234:1234::::1234:1234]:6443 + // + // In other words, the field may be set to any value that is parsable + // by Go's https://pkg.go.dev/net#ResolveIPAddr and + // https://pkg.go.dev/net#ParseIP functions. + ProxyAddr string `json:"proxyAddr,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Namespaced +// +kubebuilder:storageversion +// +kubebuilder:subresource:status + +// VirtualMachineWebConsoleRequest allows the creation of a one-time, web +// console connection to a VM. +type VirtualMachineWebConsoleRequest struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec VirtualMachineWebConsoleRequestSpec `json:"spec,omitempty"` + Status VirtualMachineWebConsoleRequestStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// VirtualMachineWebConsoleRequestList contains a list of +// VirtualMachineWebConsoleRequests. +type VirtualMachineWebConsoleRequestList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VirtualMachineWebConsoleRequest `json:"items"` +} + +func init() { + SchemeBuilder.Register( + &VirtualMachineWebConsoleRequest{}, + &VirtualMachineWebConsoleRequestList{}, + ) +} diff --git a/api/v1alpha3/virtualmachinewebconsolerequest_webhook.go b/api/v1alpha3/virtualmachinewebconsolerequest_webhook.go new file mode 100644 index 000000000..2693de83d --- /dev/null +++ b/api/v1alpha3/virtualmachinewebconsolerequest_webhook.go @@ -0,0 +1,12 @@ +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package v1alpha3 + +import ctrl "sigs.k8s.io/controller-runtime" + +func (r *VirtualMachineWebConsoleRequest) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} diff --git a/api/v1alpha3/zz_generated.deepcopy.go b/api/v1alpha3/zz_generated.deepcopy.go new file mode 100644 index 000000000..fbfbb7a89 --- /dev/null +++ b/api/v1alpha3/zz_generated.deepcopy.go @@ -0,0 +1,2120 @@ +//go:build !ignore_autogenerated + +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + "encoding/json" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/cloudinit" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/sysprep" + "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterVirtualMachineImage) DeepCopyInto(out *ClusterVirtualMachineImage) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterVirtualMachineImage. +func (in *ClusterVirtualMachineImage) DeepCopy() *ClusterVirtualMachineImage { + if in == nil { + return nil + } + out := new(ClusterVirtualMachineImage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterVirtualMachineImage) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterVirtualMachineImageList) DeepCopyInto(out *ClusterVirtualMachineImageList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterVirtualMachineImage, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterVirtualMachineImageList. +func (in *ClusterVirtualMachineImageList) DeepCopy() *ClusterVirtualMachineImageList { + if in == nil { + return nil + } + out := new(ClusterVirtualMachineImageList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterVirtualMachineImageList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DynamicDirectPathIODevice) DeepCopyInto(out *DynamicDirectPathIODevice) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicDirectPathIODevice. +func (in *DynamicDirectPathIODevice) DeepCopy() *DynamicDirectPathIODevice { + if in == nil { + return nil + } + out := new(DynamicDirectPathIODevice) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GuestHeartbeatAction) DeepCopyInto(out *GuestHeartbeatAction) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GuestHeartbeatAction. +func (in *GuestHeartbeatAction) DeepCopy() *GuestHeartbeatAction { + if in == nil { + return nil + } + out := new(GuestHeartbeatAction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GuestInfoAction) DeepCopyInto(out *GuestInfoAction) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GuestInfoAction. +func (in *GuestInfoAction) DeepCopy() *GuestInfoAction { + if in == nil { + return nil + } + out := new(GuestInfoAction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceStorage) DeepCopyInto(out *InstanceStorage) { + *out = *in + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]InstanceStorageVolume, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceStorage. +func (in *InstanceStorage) DeepCopy() *InstanceStorage { + if in == nil { + return nil + } + out := new(InstanceStorage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceStorageVolume) DeepCopyInto(out *InstanceStorageVolume) { + *out = *in + out.Size = in.Size.DeepCopy() +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceStorageVolume. +func (in *InstanceStorageVolume) DeepCopy() *InstanceStorageVolume { + if in == nil { + return nil + } + out := new(InstanceStorageVolume) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceVolumeClaimVolumeSource) DeepCopyInto(out *InstanceVolumeClaimVolumeSource) { + *out = *in + out.Size = in.Size.DeepCopy() +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceVolumeClaimVolumeSource. +func (in *InstanceVolumeClaimVolumeSource) DeepCopy() *InstanceVolumeClaimVolumeSource { + if in == nil { + return nil + } + out := new(InstanceVolumeClaimVolumeSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerIngress) DeepCopyInto(out *LoadBalancerIngress) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerIngress. +func (in *LoadBalancerIngress) DeepCopy() *LoadBalancerIngress { + if in == nil { + return nil + } + out := new(LoadBalancerIngress) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerStatus) DeepCopyInto(out *LoadBalancerStatus) { + *out = *in + if in.Ingress != nil { + in, out := &in.Ingress, &out.Ingress + *out = make([]LoadBalancerIngress, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerStatus. +func (in *LoadBalancerStatus) DeepCopy() *LoadBalancerStatus { + if in == nil { + return nil + } + out := new(LoadBalancerStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkDeviceStatus) DeepCopyInto(out *NetworkDeviceStatus) { + *out = *in + if in.IPAddresses != nil { + in, out := &in.IPAddresses, &out.IPAddresses + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDeviceStatus. +func (in *NetworkDeviceStatus) DeepCopy() *NetworkDeviceStatus { + if in == nil { + return nil + } + out := new(NetworkDeviceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkStatus) DeepCopyInto(out *NetworkStatus) { + *out = *in + if in.Devices != nil { + in, out := &in.Devices, &out.Devices + *out = make([]NetworkDeviceStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Nameservers != nil { + in, out := &in.Nameservers, &out.Nameservers + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkStatus. +func (in *NetworkStatus) DeepCopy() *NetworkStatus { + if in == nil { + return nil + } + out := new(NetworkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OVFProperty) DeepCopyInto(out *OVFProperty) { + *out = *in + if in.Default != nil { + in, out := &in.Default, &out.Default + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OVFProperty. +func (in *OVFProperty) DeepCopy() *OVFProperty { + if in == nil { + return nil + } + out := new(OVFProperty) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PersistentVolumeClaimVolumeSource) DeepCopyInto(out *PersistentVolumeClaimVolumeSource) { + *out = *in + out.PersistentVolumeClaimVolumeSource = in.PersistentVolumeClaimVolumeSource + if in.InstanceVolumeClaim != nil { + in, out := &in.InstanceVolumeClaim, &out.InstanceVolumeClaim + *out = new(InstanceVolumeClaimVolumeSource) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistentVolumeClaimVolumeSource. +func (in *PersistentVolumeClaimVolumeSource) DeepCopy() *PersistentVolumeClaimVolumeSource { + if in == nil { + return nil + } + out := new(PersistentVolumeClaimVolumeSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourcePoolSpec) DeepCopyInto(out *ResourcePoolSpec) { + *out = *in + in.Reservations.DeepCopyInto(&out.Reservations) + in.Limits.DeepCopyInto(&out.Limits) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePoolSpec. +func (in *ResourcePoolSpec) DeepCopy() *ResourcePoolSpec { + if in == nil { + return nil + } + out := new(ResourcePoolSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TCPSocketAction) DeepCopyInto(out *TCPSocketAction) { + *out = *in + out.Port = in.Port +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TCPSocketAction. +func (in *TCPSocketAction) DeepCopy() *TCPSocketAction { + if in == nil { + return nil + } + out := new(TCPSocketAction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VGPUDevice) DeepCopyInto(out *VGPUDevice) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VGPUDevice. +func (in *VGPUDevice) DeepCopy() *VGPUDevice { + if in == nil { + return nil + } + out := new(VGPUDevice) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VSphereClusterModuleStatus) DeepCopyInto(out *VSphereClusterModuleStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VSphereClusterModuleStatus. +func (in *VSphereClusterModuleStatus) DeepCopy() *VSphereClusterModuleStatus { + if in == nil { + return nil + } + out := new(VSphereClusterModuleStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualDevices) DeepCopyInto(out *VirtualDevices) { + *out = *in + if in.VGPUDevices != nil { + in, out := &in.VGPUDevices, &out.VGPUDevices + *out = make([]VGPUDevice, len(*in)) + copy(*out, *in) + } + if in.DynamicDirectPathIODevices != nil { + in, out := &in.DynamicDirectPathIODevices, &out.DynamicDirectPathIODevices + *out = make([]DynamicDirectPathIODevice, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualDevices. +func (in *VirtualDevices) DeepCopy() *VirtualDevices { + if in == nil { + return nil + } + out := new(VirtualDevices) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachine) DeepCopyInto(out *VirtualMachine) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachine. +func (in *VirtualMachine) DeepCopy() *VirtualMachine { + if in == nil { + return nil + } + out := new(VirtualMachine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachine) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineAdvancedSpec) DeepCopyInto(out *VirtualMachineAdvancedSpec) { + *out = *in + if in.BootDiskCapacity != nil { + in, out := &in.BootDiskCapacity, &out.BootDiskCapacity + x := (*in).DeepCopy() + *out = &x + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineAdvancedSpec. +func (in *VirtualMachineAdvancedSpec) DeepCopy() *VirtualMachineAdvancedSpec { + if in == nil { + return nil + } + out := new(VirtualMachineAdvancedSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineBootstrapCloudInitSpec) DeepCopyInto(out *VirtualMachineBootstrapCloudInitSpec) { + *out = *in + if in.CloudConfig != nil { + in, out := &in.CloudConfig, &out.CloudConfig + *out = new(cloudinit.CloudConfig) + (*in).DeepCopyInto(*out) + } + if in.RawCloudConfig != nil { + in, out := &in.RawCloudConfig, &out.RawCloudConfig + *out = new(common.SecretKeySelector) + **out = **in + } + if in.SSHAuthorizedKeys != nil { + in, out := &in.SSHAuthorizedKeys, &out.SSHAuthorizedKeys + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineBootstrapCloudInitSpec. +func (in *VirtualMachineBootstrapCloudInitSpec) DeepCopy() *VirtualMachineBootstrapCloudInitSpec { + if in == nil { + return nil + } + out := new(VirtualMachineBootstrapCloudInitSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineBootstrapLinuxPrepSpec) DeepCopyInto(out *VirtualMachineBootstrapLinuxPrepSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineBootstrapLinuxPrepSpec. +func (in *VirtualMachineBootstrapLinuxPrepSpec) DeepCopy() *VirtualMachineBootstrapLinuxPrepSpec { + if in == nil { + return nil + } + out := new(VirtualMachineBootstrapLinuxPrepSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineBootstrapSpec) DeepCopyInto(out *VirtualMachineBootstrapSpec) { + *out = *in + if in.CloudInit != nil { + in, out := &in.CloudInit, &out.CloudInit + *out = new(VirtualMachineBootstrapCloudInitSpec) + (*in).DeepCopyInto(*out) + } + if in.LinuxPrep != nil { + in, out := &in.LinuxPrep, &out.LinuxPrep + *out = new(VirtualMachineBootstrapLinuxPrepSpec) + **out = **in + } + if in.Sysprep != nil { + in, out := &in.Sysprep, &out.Sysprep + *out = new(VirtualMachineBootstrapSysprepSpec) + (*in).DeepCopyInto(*out) + } + if in.VAppConfig != nil { + in, out := &in.VAppConfig, &out.VAppConfig + *out = new(VirtualMachineBootstrapVAppConfigSpec) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineBootstrapSpec. +func (in *VirtualMachineBootstrapSpec) DeepCopy() *VirtualMachineBootstrapSpec { + if in == nil { + return nil + } + out := new(VirtualMachineBootstrapSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineBootstrapSysprepSpec) DeepCopyInto(out *VirtualMachineBootstrapSysprepSpec) { + *out = *in + if in.Sysprep != nil { + in, out := &in.Sysprep, &out.Sysprep + *out = new(sysprep.Sysprep) + (*in).DeepCopyInto(*out) + } + if in.RawSysprep != nil { + in, out := &in.RawSysprep, &out.RawSysprep + *out = new(common.SecretKeySelector) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineBootstrapSysprepSpec. +func (in *VirtualMachineBootstrapSysprepSpec) DeepCopy() *VirtualMachineBootstrapSysprepSpec { + if in == nil { + return nil + } + out := new(VirtualMachineBootstrapSysprepSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineBootstrapVAppConfigSpec) DeepCopyInto(out *VirtualMachineBootstrapVAppConfigSpec) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make([]common.KeyValueOrSecretKeySelectorPair, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineBootstrapVAppConfigSpec. +func (in *VirtualMachineBootstrapVAppConfigSpec) DeepCopy() *VirtualMachineBootstrapVAppConfigSpec { + if in == nil { + return nil + } + out := new(VirtualMachineBootstrapVAppConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineClass) DeepCopyInto(out *VirtualMachineClass) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineClass. +func (in *VirtualMachineClass) DeepCopy() *VirtualMachineClass { + if in == nil { + return nil + } + out := new(VirtualMachineClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineClass) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineClassHardware) DeepCopyInto(out *VirtualMachineClassHardware) { + *out = *in + out.Memory = in.Memory.DeepCopy() + in.Devices.DeepCopyInto(&out.Devices) + in.InstanceStorage.DeepCopyInto(&out.InstanceStorage) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineClassHardware. +func (in *VirtualMachineClassHardware) DeepCopy() *VirtualMachineClassHardware { + if in == nil { + return nil + } + out := new(VirtualMachineClassHardware) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineClassList) DeepCopyInto(out *VirtualMachineClassList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualMachineClass, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineClassList. +func (in *VirtualMachineClassList) DeepCopy() *VirtualMachineClassList { + if in == nil { + return nil + } + out := new(VirtualMachineClassList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineClassList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineClassPolicies) DeepCopyInto(out *VirtualMachineClassPolicies) { + *out = *in + in.Resources.DeepCopyInto(&out.Resources) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineClassPolicies. +func (in *VirtualMachineClassPolicies) DeepCopy() *VirtualMachineClassPolicies { + if in == nil { + return nil + } + out := new(VirtualMachineClassPolicies) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineClassResources) DeepCopyInto(out *VirtualMachineClassResources) { + *out = *in + in.Requests.DeepCopyInto(&out.Requests) + in.Limits.DeepCopyInto(&out.Limits) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineClassResources. +func (in *VirtualMachineClassResources) DeepCopy() *VirtualMachineClassResources { + if in == nil { + return nil + } + out := new(VirtualMachineClassResources) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineClassSpec) DeepCopyInto(out *VirtualMachineClassSpec) { + *out = *in + in.Hardware.DeepCopyInto(&out.Hardware) + in.Policies.DeepCopyInto(&out.Policies) + if in.ConfigSpec != nil { + in, out := &in.ConfigSpec, &out.ConfigSpec + *out = make(json.RawMessage, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineClassSpec. +func (in *VirtualMachineClassSpec) DeepCopy() *VirtualMachineClassSpec { + if in == nil { + return nil + } + out := new(VirtualMachineClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineClassStatus) DeepCopyInto(out *VirtualMachineClassStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineClassStatus. +func (in *VirtualMachineClassStatus) DeepCopy() *VirtualMachineClassStatus { + if in == nil { + return nil + } + out := new(VirtualMachineClassStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineConfigSpec) DeepCopyInto(out *VirtualMachineConfigSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineConfigSpec. +func (in *VirtualMachineConfigSpec) DeepCopy() *VirtualMachineConfigSpec { + if in == nil { + return nil + } + out := new(VirtualMachineConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineImage) DeepCopyInto(out *VirtualMachineImage) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineImage. +func (in *VirtualMachineImage) DeepCopy() *VirtualMachineImage { + if in == nil { + return nil + } + out := new(VirtualMachineImage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineImage) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineImageList) DeepCopyInto(out *VirtualMachineImageList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualMachineImage, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineImageList. +func (in *VirtualMachineImageList) DeepCopy() *VirtualMachineImageList { + if in == nil { + return nil + } + out := new(VirtualMachineImageList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineImageList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineImageOSInfo) DeepCopyInto(out *VirtualMachineImageOSInfo) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineImageOSInfo. +func (in *VirtualMachineImageOSInfo) DeepCopy() *VirtualMachineImageOSInfo { + if in == nil { + return nil + } + out := new(VirtualMachineImageOSInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineImageProductInfo) DeepCopyInto(out *VirtualMachineImageProductInfo) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineImageProductInfo. +func (in *VirtualMachineImageProductInfo) DeepCopy() *VirtualMachineImageProductInfo { + if in == nil { + return nil + } + out := new(VirtualMachineImageProductInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineImageSpec) DeepCopyInto(out *VirtualMachineImageSpec) { + *out = *in + if in.ProviderRef != nil { + in, out := &in.ProviderRef, &out.ProviderRef + *out = new(common.LocalObjectRef) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineImageSpec. +func (in *VirtualMachineImageSpec) DeepCopy() *VirtualMachineImageSpec { + if in == nil { + return nil + } + out := new(VirtualMachineImageSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineImageStatus) DeepCopyInto(out *VirtualMachineImageStatus) { + *out = *in + if in.Capabilities != nil { + in, out := &in.Capabilities, &out.Capabilities + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.HardwareVersion != nil { + in, out := &in.HardwareVersion, &out.HardwareVersion + *out = new(int32) + **out = **in + } + out.OSInfo = in.OSInfo + if in.OVFProperties != nil { + in, out := &in.OVFProperties, &out.OVFProperties + *out = make([]OVFProperty, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.VMwareSystemProperties != nil { + in, out := &in.VMwareSystemProperties, &out.VMwareSystemProperties + *out = make([]common.KeyValuePair, len(*in)) + copy(*out, *in) + } + out.ProductInfo = in.ProductInfo + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineImageStatus. +func (in *VirtualMachineImageStatus) DeepCopy() *VirtualMachineImageStatus { + if in == nil { + return nil + } + out := new(VirtualMachineImageStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineList) DeepCopyInto(out *VirtualMachineList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualMachine, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineList. +func (in *VirtualMachineList) DeepCopy() *VirtualMachineList { + if in == nil { + return nil + } + out := new(VirtualMachineList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkConfigDHCPOptionsStatus) DeepCopyInto(out *VirtualMachineNetworkConfigDHCPOptionsStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkConfigDHCPOptionsStatus. +func (in *VirtualMachineNetworkConfigDHCPOptionsStatus) DeepCopy() *VirtualMachineNetworkConfigDHCPOptionsStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkConfigDHCPOptionsStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkConfigDHCPStatus) DeepCopyInto(out *VirtualMachineNetworkConfigDHCPStatus) { + *out = *in + if in.IP4 != nil { + in, out := &in.IP4, &out.IP4 + *out = new(VirtualMachineNetworkConfigDHCPOptionsStatus) + **out = **in + } + if in.IP6 != nil { + in, out := &in.IP6, &out.IP6 + *out = new(VirtualMachineNetworkConfigDHCPOptionsStatus) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkConfigDHCPStatus. +func (in *VirtualMachineNetworkConfigDHCPStatus) DeepCopy() *VirtualMachineNetworkConfigDHCPStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkConfigDHCPStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkConfigDNSStatus) DeepCopyInto(out *VirtualMachineNetworkConfigDNSStatus) { + *out = *in + if in.Nameservers != nil { + in, out := &in.Nameservers, &out.Nameservers + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SearchDomains != nil { + in, out := &in.SearchDomains, &out.SearchDomains + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkConfigDNSStatus. +func (in *VirtualMachineNetworkConfigDNSStatus) DeepCopy() *VirtualMachineNetworkConfigDNSStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkConfigDNSStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkConfigInterfaceIPStatus) DeepCopyInto(out *VirtualMachineNetworkConfigInterfaceIPStatus) { + *out = *in + if in.DHCP != nil { + in, out := &in.DHCP, &out.DHCP + *out = new(VirtualMachineNetworkConfigDHCPStatus) + (*in).DeepCopyInto(*out) + } + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkConfigInterfaceIPStatus. +func (in *VirtualMachineNetworkConfigInterfaceIPStatus) DeepCopy() *VirtualMachineNetworkConfigInterfaceIPStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkConfigInterfaceIPStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkConfigInterfaceStatus) DeepCopyInto(out *VirtualMachineNetworkConfigInterfaceStatus) { + *out = *in + if in.IP != nil { + in, out := &in.IP, &out.IP + *out = new(VirtualMachineNetworkConfigInterfaceIPStatus) + (*in).DeepCopyInto(*out) + } + if in.DNS != nil { + in, out := &in.DNS, &out.DNS + *out = new(VirtualMachineNetworkConfigDNSStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkConfigInterfaceStatus. +func (in *VirtualMachineNetworkConfigInterfaceStatus) DeepCopy() *VirtualMachineNetworkConfigInterfaceStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkConfigInterfaceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkConfigStatus) DeepCopyInto(out *VirtualMachineNetworkConfigStatus) { + *out = *in + if in.Interfaces != nil { + in, out := &in.Interfaces, &out.Interfaces + *out = make([]VirtualMachineNetworkConfigInterfaceStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DNS != nil { + in, out := &in.DNS, &out.DNS + *out = new(VirtualMachineNetworkConfigDNSStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkConfigStatus. +func (in *VirtualMachineNetworkConfigStatus) DeepCopy() *VirtualMachineNetworkConfigStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkConfigStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkDHCPOptionsStatus) DeepCopyInto(out *VirtualMachineNetworkDHCPOptionsStatus) { + *out = *in + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make([]common.KeyValuePair, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkDHCPOptionsStatus. +func (in *VirtualMachineNetworkDHCPOptionsStatus) DeepCopy() *VirtualMachineNetworkDHCPOptionsStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkDHCPOptionsStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkDHCPStatus) DeepCopyInto(out *VirtualMachineNetworkDHCPStatus) { + *out = *in + in.IP4.DeepCopyInto(&out.IP4) + in.IP6.DeepCopyInto(&out.IP6) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkDHCPStatus. +func (in *VirtualMachineNetworkDHCPStatus) DeepCopy() *VirtualMachineNetworkDHCPStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkDHCPStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkDNSStatus) DeepCopyInto(out *VirtualMachineNetworkDNSStatus) { + *out = *in + if in.Nameservers != nil { + in, out := &in.Nameservers, &out.Nameservers + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SearchDomains != nil { + in, out := &in.SearchDomains, &out.SearchDomains + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkDNSStatus. +func (in *VirtualMachineNetworkDNSStatus) DeepCopy() *VirtualMachineNetworkDNSStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkDNSStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkIPRouteGatewayStatus) DeepCopyInto(out *VirtualMachineNetworkIPRouteGatewayStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkIPRouteGatewayStatus. +func (in *VirtualMachineNetworkIPRouteGatewayStatus) DeepCopy() *VirtualMachineNetworkIPRouteGatewayStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkIPRouteGatewayStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkIPRouteStatus) DeepCopyInto(out *VirtualMachineNetworkIPRouteStatus) { + *out = *in + out.Gateway = in.Gateway +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkIPRouteStatus. +func (in *VirtualMachineNetworkIPRouteStatus) DeepCopy() *VirtualMachineNetworkIPRouteStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkIPRouteStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkIPStackStatus) DeepCopyInto(out *VirtualMachineNetworkIPStackStatus) { + *out = *in + if in.DHCP != nil { + in, out := &in.DHCP, &out.DHCP + *out = new(VirtualMachineNetworkDHCPStatus) + (*in).DeepCopyInto(*out) + } + if in.DNS != nil { + in, out := &in.DNS, &out.DNS + *out = new(VirtualMachineNetworkDNSStatus) + (*in).DeepCopyInto(*out) + } + if in.IPRoutes != nil { + in, out := &in.IPRoutes, &out.IPRoutes + *out = make([]VirtualMachineNetworkIPRouteStatus, len(*in)) + copy(*out, *in) + } + if in.KernelConfig != nil { + in, out := &in.KernelConfig, &out.KernelConfig + *out = make([]common.KeyValuePair, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkIPStackStatus. +func (in *VirtualMachineNetworkIPStackStatus) DeepCopy() *VirtualMachineNetworkIPStackStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkIPStackStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkInterfaceIPAddrStatus) DeepCopyInto(out *VirtualMachineNetworkInterfaceIPAddrStatus) { + *out = *in + in.Lifetime.DeepCopyInto(&out.Lifetime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkInterfaceIPAddrStatus. +func (in *VirtualMachineNetworkInterfaceIPAddrStatus) DeepCopy() *VirtualMachineNetworkInterfaceIPAddrStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkInterfaceIPAddrStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkInterfaceIPStatus) DeepCopyInto(out *VirtualMachineNetworkInterfaceIPStatus) { + *out = *in + if in.AutoConfigurationEnabled != nil { + in, out := &in.AutoConfigurationEnabled, &out.AutoConfigurationEnabled + *out = new(bool) + **out = **in + } + if in.DHCP != nil { + in, out := &in.DHCP, &out.DHCP + *out = new(VirtualMachineNetworkDHCPStatus) + (*in).DeepCopyInto(*out) + } + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]VirtualMachineNetworkInterfaceIPAddrStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkInterfaceIPStatus. +func (in *VirtualMachineNetworkInterfaceIPStatus) DeepCopy() *VirtualMachineNetworkInterfaceIPStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkInterfaceIPStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkInterfaceSpec) DeepCopyInto(out *VirtualMachineNetworkInterfaceSpec) { + *out = *in + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(common.PartialObjectRef) + **out = **in + } + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.MTU != nil { + in, out := &in.MTU, &out.MTU + *out = new(int64) + **out = **in + } + if in.Nameservers != nil { + in, out := &in.Nameservers, &out.Nameservers + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Routes != nil { + in, out := &in.Routes, &out.Routes + *out = make([]VirtualMachineNetworkRouteSpec, len(*in)) + copy(*out, *in) + } + if in.SearchDomains != nil { + in, out := &in.SearchDomains, &out.SearchDomains + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkInterfaceSpec. +func (in *VirtualMachineNetworkInterfaceSpec) DeepCopy() *VirtualMachineNetworkInterfaceSpec { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkInterfaceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkInterfaceStatus) DeepCopyInto(out *VirtualMachineNetworkInterfaceStatus) { + *out = *in + if in.IP != nil { + in, out := &in.IP, &out.IP + *out = new(VirtualMachineNetworkInterfaceIPStatus) + (*in).DeepCopyInto(*out) + } + if in.DNS != nil { + in, out := &in.DNS, &out.DNS + *out = new(VirtualMachineNetworkDNSStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkInterfaceStatus. +func (in *VirtualMachineNetworkInterfaceStatus) DeepCopy() *VirtualMachineNetworkInterfaceStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkInterfaceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkRouteSpec) DeepCopyInto(out *VirtualMachineNetworkRouteSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkRouteSpec. +func (in *VirtualMachineNetworkRouteSpec) DeepCopy() *VirtualMachineNetworkRouteSpec { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkRouteSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkRouteStatus) DeepCopyInto(out *VirtualMachineNetworkRouteStatus) { + *out = *in + if in.IPRoutes != nil { + in, out := &in.IPRoutes, &out.IPRoutes + *out = make([]VirtualMachineNetworkIPRouteStatus, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkRouteStatus. +func (in *VirtualMachineNetworkRouteStatus) DeepCopy() *VirtualMachineNetworkRouteStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkRouteStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkSpec) DeepCopyInto(out *VirtualMachineNetworkSpec) { + *out = *in + if in.Nameservers != nil { + in, out := &in.Nameservers, &out.Nameservers + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SearchDomains != nil { + in, out := &in.SearchDomains, &out.SearchDomains + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Interfaces != nil { + in, out := &in.Interfaces, &out.Interfaces + *out = make([]VirtualMachineNetworkInterfaceSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkSpec. +func (in *VirtualMachineNetworkSpec) DeepCopy() *VirtualMachineNetworkSpec { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineNetworkStatus) DeepCopyInto(out *VirtualMachineNetworkStatus) { + *out = *in + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = new(VirtualMachineNetworkConfigStatus) + (*in).DeepCopyInto(*out) + } + if in.Interfaces != nil { + in, out := &in.Interfaces, &out.Interfaces + *out = make([]VirtualMachineNetworkInterfaceStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.IPStacks != nil { + in, out := &in.IPStacks, &out.IPStacks + *out = make([]VirtualMachineNetworkIPStackStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineNetworkStatus. +func (in *VirtualMachineNetworkStatus) DeepCopy() *VirtualMachineNetworkStatus { + if in == nil { + return nil + } + out := new(VirtualMachineNetworkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachinePublishRequest) DeepCopyInto(out *VirtualMachinePublishRequest) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachinePublishRequest. +func (in *VirtualMachinePublishRequest) DeepCopy() *VirtualMachinePublishRequest { + if in == nil { + return nil + } + out := new(VirtualMachinePublishRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachinePublishRequest) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachinePublishRequestList) DeepCopyInto(out *VirtualMachinePublishRequestList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualMachinePublishRequest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachinePublishRequestList. +func (in *VirtualMachinePublishRequestList) DeepCopy() *VirtualMachinePublishRequestList { + if in == nil { + return nil + } + out := new(VirtualMachinePublishRequestList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachinePublishRequestList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachinePublishRequestSource) DeepCopyInto(out *VirtualMachinePublishRequestSource) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachinePublishRequestSource. +func (in *VirtualMachinePublishRequestSource) DeepCopy() *VirtualMachinePublishRequestSource { + if in == nil { + return nil + } + out := new(VirtualMachinePublishRequestSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachinePublishRequestSpec) DeepCopyInto(out *VirtualMachinePublishRequestSpec) { + *out = *in + out.Source = in.Source + out.Target = in.Target + if in.TTLSecondsAfterFinished != nil { + in, out := &in.TTLSecondsAfterFinished, &out.TTLSecondsAfterFinished + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachinePublishRequestSpec. +func (in *VirtualMachinePublishRequestSpec) DeepCopy() *VirtualMachinePublishRequestSpec { + if in == nil { + return nil + } + out := new(VirtualMachinePublishRequestSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachinePublishRequestStatus) DeepCopyInto(out *VirtualMachinePublishRequestStatus) { + *out = *in + if in.SourceRef != nil { + in, out := &in.SourceRef, &out.SourceRef + *out = new(VirtualMachinePublishRequestSource) + **out = **in + } + if in.TargetRef != nil { + in, out := &in.TargetRef, &out.TargetRef + *out = new(VirtualMachinePublishRequestTarget) + **out = **in + } + in.CompletionTime.DeepCopyInto(&out.CompletionTime) + in.StartTime.DeepCopyInto(&out.StartTime) + in.LastAttemptTime.DeepCopyInto(&out.LastAttemptTime) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachinePublishRequestStatus. +func (in *VirtualMachinePublishRequestStatus) DeepCopy() *VirtualMachinePublishRequestStatus { + if in == nil { + return nil + } + out := new(VirtualMachinePublishRequestStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachinePublishRequestTarget) DeepCopyInto(out *VirtualMachinePublishRequestTarget) { + *out = *in + out.Item = in.Item + out.Location = in.Location +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachinePublishRequestTarget. +func (in *VirtualMachinePublishRequestTarget) DeepCopy() *VirtualMachinePublishRequestTarget { + if in == nil { + return nil + } + out := new(VirtualMachinePublishRequestTarget) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachinePublishRequestTargetItem) DeepCopyInto(out *VirtualMachinePublishRequestTargetItem) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachinePublishRequestTargetItem. +func (in *VirtualMachinePublishRequestTargetItem) DeepCopy() *VirtualMachinePublishRequestTargetItem { + if in == nil { + return nil + } + out := new(VirtualMachinePublishRequestTargetItem) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachinePublishRequestTargetLocation) DeepCopyInto(out *VirtualMachinePublishRequestTargetLocation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachinePublishRequestTargetLocation. +func (in *VirtualMachinePublishRequestTargetLocation) DeepCopy() *VirtualMachinePublishRequestTargetLocation { + if in == nil { + return nil + } + out := new(VirtualMachinePublishRequestTargetLocation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineReadinessProbeSpec) DeepCopyInto(out *VirtualMachineReadinessProbeSpec) { + *out = *in + if in.TCPSocket != nil { + in, out := &in.TCPSocket, &out.TCPSocket + *out = new(TCPSocketAction) + **out = **in + } + if in.GuestHeartbeat != nil { + in, out := &in.GuestHeartbeat, &out.GuestHeartbeat + *out = new(GuestHeartbeatAction) + **out = **in + } + if in.GuestInfo != nil { + in, out := &in.GuestInfo, &out.GuestInfo + *out = make([]GuestInfoAction, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineReadinessProbeSpec. +func (in *VirtualMachineReadinessProbeSpec) DeepCopy() *VirtualMachineReadinessProbeSpec { + if in == nil { + return nil + } + out := new(VirtualMachineReadinessProbeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineReservedSpec) DeepCopyInto(out *VirtualMachineReservedSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineReservedSpec. +func (in *VirtualMachineReservedSpec) DeepCopy() *VirtualMachineReservedSpec { + if in == nil { + return nil + } + out := new(VirtualMachineReservedSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineResourceSpec) DeepCopyInto(out *VirtualMachineResourceSpec) { + *out = *in + out.Cpu = in.Cpu.DeepCopy() + out.Memory = in.Memory.DeepCopy() +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineResourceSpec. +func (in *VirtualMachineResourceSpec) DeepCopy() *VirtualMachineResourceSpec { + if in == nil { + return nil + } + out := new(VirtualMachineResourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineService) DeepCopyInto(out *VirtualMachineService) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineService. +func (in *VirtualMachineService) DeepCopy() *VirtualMachineService { + if in == nil { + return nil + } + out := new(VirtualMachineService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineService) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineServiceList) DeepCopyInto(out *VirtualMachineServiceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualMachineService, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineServiceList. +func (in *VirtualMachineServiceList) DeepCopy() *VirtualMachineServiceList { + if in == nil { + return nil + } + out := new(VirtualMachineServiceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineServiceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineServicePort) DeepCopyInto(out *VirtualMachineServicePort) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineServicePort. +func (in *VirtualMachineServicePort) DeepCopy() *VirtualMachineServicePort { + if in == nil { + return nil + } + out := new(VirtualMachineServicePort) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineServiceSpec) DeepCopyInto(out *VirtualMachineServiceSpec) { + *out = *in + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]VirtualMachineServicePort, len(*in)) + copy(*out, *in) + } + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.LoadBalancerSourceRanges != nil { + in, out := &in.LoadBalancerSourceRanges, &out.LoadBalancerSourceRanges + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineServiceSpec. +func (in *VirtualMachineServiceSpec) DeepCopy() *VirtualMachineServiceSpec { + if in == nil { + return nil + } + out := new(VirtualMachineServiceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineServiceStatus) DeepCopyInto(out *VirtualMachineServiceStatus) { + *out = *in + in.LoadBalancer.DeepCopyInto(&out.LoadBalancer) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineServiceStatus. +func (in *VirtualMachineServiceStatus) DeepCopy() *VirtualMachineServiceStatus { + if in == nil { + return nil + } + out := new(VirtualMachineServiceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineSetResourcePolicy) DeepCopyInto(out *VirtualMachineSetResourcePolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineSetResourcePolicy. +func (in *VirtualMachineSetResourcePolicy) DeepCopy() *VirtualMachineSetResourcePolicy { + if in == nil { + return nil + } + out := new(VirtualMachineSetResourcePolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineSetResourcePolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineSetResourcePolicyList) DeepCopyInto(out *VirtualMachineSetResourcePolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualMachineSetResourcePolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineSetResourcePolicyList. +func (in *VirtualMachineSetResourcePolicyList) DeepCopy() *VirtualMachineSetResourcePolicyList { + if in == nil { + return nil + } + out := new(VirtualMachineSetResourcePolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineSetResourcePolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineSetResourcePolicySpec) DeepCopyInto(out *VirtualMachineSetResourcePolicySpec) { + *out = *in + in.ResourcePool.DeepCopyInto(&out.ResourcePool) + if in.ClusterModuleGroups != nil { + in, out := &in.ClusterModuleGroups, &out.ClusterModuleGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineSetResourcePolicySpec. +func (in *VirtualMachineSetResourcePolicySpec) DeepCopy() *VirtualMachineSetResourcePolicySpec { + if in == nil { + return nil + } + out := new(VirtualMachineSetResourcePolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineSetResourcePolicyStatus) DeepCopyInto(out *VirtualMachineSetResourcePolicyStatus) { + *out = *in + if in.ClusterModules != nil { + in, out := &in.ClusterModules, &out.ClusterModules + *out = make([]VSphereClusterModuleStatus, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineSetResourcePolicyStatus. +func (in *VirtualMachineSetResourcePolicyStatus) DeepCopy() *VirtualMachineSetResourcePolicyStatus { + if in == nil { + return nil + } + out := new(VirtualMachineSetResourcePolicyStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineSpec) DeepCopyInto(out *VirtualMachineSpec) { + *out = *in + if in.Bootstrap != nil { + in, out := &in.Bootstrap, &out.Bootstrap + *out = new(VirtualMachineBootstrapSpec) + (*in).DeepCopyInto(*out) + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(VirtualMachineNetworkSpec) + (*in).DeepCopyInto(*out) + } + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]VirtualMachineVolume, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ReadinessProbe != nil { + in, out := &in.ReadinessProbe, &out.ReadinessProbe + *out = new(VirtualMachineReadinessProbeSpec) + (*in).DeepCopyInto(*out) + } + if in.Advanced != nil { + in, out := &in.Advanced, &out.Advanced + *out = new(VirtualMachineAdvancedSpec) + (*in).DeepCopyInto(*out) + } + if in.Reserved != nil { + in, out := &in.Reserved, &out.Reserved + *out = new(VirtualMachineReservedSpec) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineSpec. +func (in *VirtualMachineSpec) DeepCopy() *VirtualMachineSpec { + if in == nil { + return nil + } + out := new(VirtualMachineSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineStatus) DeepCopyInto(out *VirtualMachineStatus) { + *out = *in + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(common.LocalObjectRef) + **out = **in + } + if in.Class != nil { + in, out := &in.Class, &out.Class + *out = new(common.LocalObjectRef) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(VirtualMachineNetworkStatus) + (*in).DeepCopyInto(*out) + } + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]VirtualMachineVolumeStatus, len(*in)) + copy(*out, *in) + } + if in.ChangeBlockTracking != nil { + in, out := &in.ChangeBlockTracking, &out.ChangeBlockTracking + *out = new(bool) + **out = **in + } + if in.LastRestartTime != nil { + in, out := &in.LastRestartTime, &out.LastRestartTime + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineStatus. +func (in *VirtualMachineStatus) DeepCopy() *VirtualMachineStatus { + if in == nil { + return nil + } + out := new(VirtualMachineStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineTemplate) DeepCopyInto(out *VirtualMachineTemplate) { + *out = *in + in.Net.DeepCopyInto(&out.Net) + if in.VM != nil { + in, out := &in.VM, &out.VM + *out = new(VirtualMachine) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineTemplate. +func (in *VirtualMachineTemplate) DeepCopy() *VirtualMachineTemplate { + if in == nil { + return nil + } + out := new(VirtualMachineTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineVolume) DeepCopyInto(out *VirtualMachineVolume) { + *out = *in + in.VirtualMachineVolumeSource.DeepCopyInto(&out.VirtualMachineVolumeSource) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineVolume. +func (in *VirtualMachineVolume) DeepCopy() *VirtualMachineVolume { + if in == nil { + return nil + } + out := new(VirtualMachineVolume) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineVolumeSource) DeepCopyInto(out *VirtualMachineVolumeSource) { + *out = *in + if in.PersistentVolumeClaim != nil { + in, out := &in.PersistentVolumeClaim, &out.PersistentVolumeClaim + *out = new(PersistentVolumeClaimVolumeSource) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineVolumeSource. +func (in *VirtualMachineVolumeSource) DeepCopy() *VirtualMachineVolumeSource { + if in == nil { + return nil + } + out := new(VirtualMachineVolumeSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineVolumeStatus) DeepCopyInto(out *VirtualMachineVolumeStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineVolumeStatus. +func (in *VirtualMachineVolumeStatus) DeepCopy() *VirtualMachineVolumeStatus { + if in == nil { + return nil + } + out := new(VirtualMachineVolumeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineWebConsoleRequest) DeepCopyInto(out *VirtualMachineWebConsoleRequest) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineWebConsoleRequest. +func (in *VirtualMachineWebConsoleRequest) DeepCopy() *VirtualMachineWebConsoleRequest { + if in == nil { + return nil + } + out := new(VirtualMachineWebConsoleRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineWebConsoleRequest) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineWebConsoleRequestList) DeepCopyInto(out *VirtualMachineWebConsoleRequestList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualMachineWebConsoleRequest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineWebConsoleRequestList. +func (in *VirtualMachineWebConsoleRequestList) DeepCopy() *VirtualMachineWebConsoleRequestList { + if in == nil { + return nil + } + out := new(VirtualMachineWebConsoleRequestList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineWebConsoleRequestList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineWebConsoleRequestSpec) DeepCopyInto(out *VirtualMachineWebConsoleRequestSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineWebConsoleRequestSpec. +func (in *VirtualMachineWebConsoleRequestSpec) DeepCopy() *VirtualMachineWebConsoleRequestSpec { + if in == nil { + return nil + } + out := new(VirtualMachineWebConsoleRequestSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineWebConsoleRequestStatus) DeepCopyInto(out *VirtualMachineWebConsoleRequestStatus) { + *out = *in + in.ExpiryTime.DeepCopyInto(&out.ExpiryTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineWebConsoleRequestStatus. +func (in *VirtualMachineWebConsoleRequestStatus) DeepCopy() *VirtualMachineWebConsoleRequestStatus { + if in == nil { + return nil + } + out := new(VirtualMachineWebConsoleRequestStatus) + in.DeepCopyInto(out) + return out +} diff --git a/config/crd/bases/vmoperator.vmware.com_clustervirtualmachineimages.yaml b/config/crd/bases/vmoperator.vmware.com_clustervirtualmachineimages.yaml index 7d5e57f57..923b647d6 100644 --- a/config/crd/bases/vmoperator.vmware.com_clustervirtualmachineimages.yaml +++ b/config/crd/bases/vmoperator.vmware.com_clustervirtualmachineimages.yaml @@ -507,6 +507,308 @@ spec: Version describes the operating system version. + This value is also added to the image resource's labels as + VirtualMachineImageOSVersionLabel. + type: string + type: object + ovfProperties: + description: |- + OVFProperties describes the observed user configurable 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 + vmwareSystemProperties: + description: |- + VMwareSystemProperties describes the observed VMware system properties defined for + this image. + items: + description: |- + KeyValuePair is useful when wanting to realize a map as a list of key/value + pairs. + properties: + key: + description: Key is the key part of the key/value pair. + type: string + value: + description: Value is the optional value part of the key/value + pair. + type: string + required: + - key + type: object + type: array + 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: v1alpha3 + 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. + + + 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: + + + * cloud-init + * nvidia-gpu + * sriov-net + + + 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.\n---\nThis struct is intended for + direct use as an array at the field path .status.conditions. For + example,\n\n\n\ttype FooStatus struct{\n\t // Represents the + observations of a foo's current state.\n\t // Known .status.conditions.type + are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // + +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t + \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" + patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t + \ // other fields\n\t}" + 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. + + + 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. + + + This value is also added to the image resource's labels as + VirtualMachineImageOSIDLabel. + type: string + type: + description: |- + Type describes the operating system type. + + + This value is also added to the image resource's labels as + VirtualMachineImageOSTypeLabel. + type: string + version: + description: |- + Version describes the operating system version. + + This value is also added to the image resource's labels as VirtualMachineImageOSVersionLabel. type: string diff --git a/config/crd/bases/vmoperator.vmware.com_virtualmachineclasses.yaml b/config/crd/bases/vmoperator.vmware.com_virtualmachineclasses.yaml index 6a8a2e900..25f26752c 100644 --- a/config/crd/bases/vmoperator.vmware.com_virtualmachineclasses.yaml +++ b/config/crd/bases/vmoperator.vmware.com_virtualmachineclasses.yaml @@ -448,6 +448,223 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .spec.hardware.cpus + name: CPU + type: string + - jsonPath: .spec.hardware.memory + name: Memory + type: string + - jsonPath: .status.capabilities + name: Capabilities + priority: 1 + type: string + name: v1alpha3 + schema: + openAPIV3Schema: + description: |- + VirtualMachineClass is the schema for the virtualmachineclasses API and + represents the desired state and observed status of a virtualmachineclasses + resource. + 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: VirtualMachineClassSpec defines the desired state of VirtualMachineClass. + properties: + configSpec: + description: |- + ConfigSpec describes additional configuration information for a + VirtualMachine. + The contents of this field are the VirtualMachineConfigSpec data object + (https://bit.ly/3HDtiRu) marshaled to JSON using the discriminator + field "_typeName" to preserve type information. + type: object + x-kubernetes-preserve-unknown-fields: true + controllerName: + description: |- + ControllerName describes the name of the controller responsible for + reconciling VirtualMachine resources that are realized from this + VirtualMachineClass. + + + When omitted, controllers reconciling VirtualMachine resources determine + the default controller name from the environment variable + DEFAULT_VM_CLASS_CONTROLLER_NAME. If this environment variable is not + defined or empty, it defaults to vmoperator.vmware.com/vsphere. + + + Once a non-empty value is assigned to this field, attempts to set this + field to an empty value will be silently ignored. + type: string + description: + description: |- + Description describes the configuration of the VirtualMachineClass which + is not related to virtual hardware or infrastructure policy. This field + is used to address remaining specs about this VirtualMachineClass. + type: string + hardware: + description: |- + Hardware describes the configuration of the VirtualMachineClass + attributes related to virtual hardware. The configuration specified in + this field is used to customize the virtual hardware characteristics of + any VirtualMachine associated with this VirtualMachineClass. + properties: + cpus: + format: int64 + type: integer + devices: + description: |- + VirtualDevices contains information about the virtual devices associated + with a VirtualMachineClass. + properties: + dynamicDirectPathIODevices: + items: + description: |- + DynamicDirectPathIODevice contains the configuration corresponding to a + Dynamic DirectPath I/O device. + properties: + customLabel: + type: string + deviceID: + format: int64 + type: integer + vendorID: + format: int64 + type: integer + required: + - deviceID + - vendorID + type: object + type: array + vgpuDevices: + items: + description: VGPUDevice contains the configuration corresponding + to a vGPU device. + properties: + profileName: + type: string + required: + - profileName + type: object + type: array + x-kubernetes-list-map-keys: + - profileName + x-kubernetes-list-type: map + type: object + instanceStorage: + description: |- + InstanceStorage provides information used to configure instance + storage volumes for a VirtualMachine. + properties: + storageClass: + description: |- + StorageClass refers to the name of a StorageClass resource used to + provide the storage for the configured instance storage volumes. + The value of this field has no relationship to or bearing on the field + virtualMachine.spec.storageClass. Please note the referred StorageClass + must be available in the same namespace as the VirtualMachineClass that + uses it for configuring instance storage. + type: string + volumes: + description: |- + Volumes describes instance storage volumes created for a VirtualMachine + instance that use this VirtualMachineClass. + items: + description: |- + InstanceStorageVolume contains information required to create an + instance storage volume on a VirtualMachine. + properties: + size: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - size + type: object + type: array + type: object + memory: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + policies: + description: |- + Policies describes the configuration of the VirtualMachineClass + attributes related to virtual infrastructure policy. The configuration + specified in this field is used to customize various policies related to + infrastructure resource consumption. + properties: + resources: + description: |- + VirtualMachineClassResources describes the virtual hardware resource + reservations and limits configuration to be used by a VirtualMachineClass. + properties: + limits: + description: VirtualMachineResourceSpec describes a virtual + hardware policy specification. + properties: + cpu: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + memory: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + description: VirtualMachineResourceSpec describes a virtual + hardware policy specification. + properties: + cpu: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + memory: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + type: object + type: object + status: + description: VirtualMachineClassStatus defines the observed state of VirtualMachineClass. + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/vmoperator.vmware.com_virtualmachineimages.yaml b/config/crd/bases/vmoperator.vmware.com_virtualmachineimages.yaml index d802eb55a..a704ed5f3 100644 --- a/config/crd/bases/vmoperator.vmware.com_virtualmachineimages.yaml +++ b/config/crd/bases/vmoperator.vmware.com_virtualmachineimages.yaml @@ -508,6 +508,310 @@ spec: Version describes the operating system version. + This value is also added to the image resource's labels as + VirtualMachineImageOSVersionLabel. + type: string + type: object + ovfProperties: + description: |- + OVFProperties describes the observed user configurable 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 + vmwareSystemProperties: + description: |- + VMwareSystemProperties describes the observed VMware system properties defined for + this image. + items: + description: |- + KeyValuePair is useful when wanting to realize a map as a list of key/value + pairs. + properties: + key: + description: Key is the key part of the key/value pair. + type: string + value: + description: Value is the optional value part of the key/value + pair. + type: string + required: + - key + type: object + type: array + 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 + - jsonPath: .status.capabilities + name: Capabilities + type: string + name: v1alpha3 + schema: + openAPIV3Schema: + description: VirtualMachineImage is the schema for the virtualmachineimages + 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. + + + 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: + + + * cloud-init + * nvidia-gpu + * sriov-net + + + 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.\n---\nThis struct is intended for + direct use as an array at the field path .status.conditions. For + example,\n\n\n\ttype FooStatus struct{\n\t // Represents the + observations of a foo's current state.\n\t // Known .status.conditions.type + are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // + +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t + \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" + patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t + \ // other fields\n\t}" + 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. + + + 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. + + + This value is also added to the image resource's labels as + VirtualMachineImageOSIDLabel. + type: string + type: + description: |- + Type describes the operating system type. + + + This value is also added to the image resource's labels as + VirtualMachineImageOSTypeLabel. + type: string + version: + description: |- + Version describes the operating system version. + + This value is also added to the image resource's labels as VirtualMachineImageOSVersionLabel. type: string diff --git a/config/crd/bases/vmoperator.vmware.com_virtualmachinepublishrequests.yaml b/config/crd/bases/vmoperator.vmware.com_virtualmachinepublishrequests.yaml index d8e5424fd..8695e5c48 100644 --- a/config/crd/bases/vmoperator.vmware.com_virtualmachinepublishrequests.yaml +++ b/config/crd/bases/vmoperator.vmware.com_virtualmachinepublishrequests.yaml @@ -697,6 +697,389 @@ spec: the VM is published. + Please note this value is optional and if omitted, the controller + will use spec.source.name + "-image" as the name of the published + item. + properties: + description: + description: Description is the description to assign to the + published object. + type: string + name: + description: |- + Name is the name of the published object. + + + 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. + + + If omitted then the controller will use spec.source.name + "-image". + type: string + type: object + location: + description: |- + Location contains information about the location to which to publish + the VM. + properties: + apiVersion: + default: imageregistry.vmware.com/v1alpha1 + description: APIVersion is the API version of the referenced + object. + type: string + kind: + default: ContentLibrary + description: Kind is the kind of referenced object. + type: string + name: + description: |- + Name is the name of the referenced object. + + + Please note an error will be returned if this field is not + set in a namespace that lacks a default publication target. + + + A default publication target is a resource with an API version + equal to spec.target.location.apiVersion, a kind equal to + spec.target.location.kind, and has the label + "imageregistry.vmware.com/default". + type: string + type: object + type: object + type: object + type: object + served: true + storage: false + subresources: + status: {} + - name: v1alpha3 + schema: + openAPIV3Schema: + description: |- + VirtualMachinePublishRequest defines the information necessary to publish a + VirtualMachine as a VirtualMachineImage to an image registry. + 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: |- + VirtualMachinePublishRequestSpec defines the desired state of a + VirtualMachinePublishRequest. + + + All the fields in this spec are optional. This is especially useful when a + DevOps persona wants to publish a VM without doing anything more than + applying a VirtualMachinePublishRequest resource that has the same name + as said VM in the same namespace as said VM. + properties: + source: + description: |- + Source is the source of the publication request, ex. a VirtualMachine + resource. + + + If this value is omitted then the publication controller checks to + see if there is a resource with the same name as this + VirtualMachinePublishRequest resource, an API version equal to + spec.source.apiVersion, and a kind equal to spec.source.kind. If such + a resource exists, then it is the source of the publication. + properties: + apiVersion: + default: vmoperator.vmware.com/v1alpha1 + description: APIVersion is the API version of the referenced object. + type: string + kind: + default: VirtualMachine + description: Kind is the kind of referenced object. + type: string + name: + description: |- + Name is the name of the referenced object. + + + If omitted this value defaults to the name of the + VirtualMachinePublishRequest resource. + type: string + type: object + target: + description: |- + Target is the target of the publication request, ex. item + information and a ContentLibrary resource. + + + If this value is omitted, the controller uses spec.source.name + "-image" + as the name of the published item. Additionally, when omitted the + controller attempts to identify the target location by matching a + resource with an API version equal to spec.target.location.apiVersion, a + kind equal to spec.target.location.kind, w/ the label + "imageregistry.vmware.com/default". + + + Please note that while optional, if a VirtualMachinePublishRequest sans + target information is applied to a namespace without a default + publication target, then the VirtualMachinePublishRequest resource + will be marked in error. + properties: + item: + description: |- + Item contains information about the name of the object to which + the VM is published. + + + Please note this value is optional and if omitted, the controller + will use spec.source.name + "-image" as the name of the published + item. + properties: + description: + description: Description is the description to assign to the + published object. + type: string + name: + description: |- + Name is the name of the published object. + + + 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. + + + If omitted then the controller will use spec.source.name + "-image". + type: string + type: object + location: + description: |- + Location contains information about the location to which to publish + the VM. + properties: + apiVersion: + default: imageregistry.vmware.com/v1alpha1 + description: APIVersion is the API version of the referenced + object. + type: string + kind: + default: ContentLibrary + description: Kind is the kind of referenced object. + type: string + name: + description: |- + Name is the name of the referenced object. + + + Please note an error will be returned if this field is not + set in a namespace that lacks a default publication target. + + + A default publication target is a resource with an API version + equal to spec.target.location.apiVersion, a kind equal to + spec.target.location.kind, and has the label + "imageregistry.vmware.com/default". + type: string + type: object + type: object + ttlSecondsAfterFinished: + description: |- + TTLSecondsAfterFinished is the time-to-live duration for how long this + resource will be allowed to exist once the publication operation + completes. After the TTL expires, the resource will be automatically + deleted without the user having to take any direct action. + + + If this field is unset then the request resource will not be + automatically deleted. If this field is set to zero then the request + resource is eligible for deletion immediately after it finishes. + format: int64 + minimum: 0 + type: integer + type: object + status: + description: |- + VirtualMachinePublishRequestStatus defines the observed state of a + VirtualMachinePublishRequest. + properties: + attempts: + description: |- + Attempts represents the number of times the request to publish the VM + has been attempted. + format: int64 + type: integer + completionTime: + description: |- + CompletionTime represents time when the request was completed. It is not + guaranteed to be set in happens-before order across separate operations. + It is represented in RFC3339 form and is in UTC. + + + The value of this field should be equal to the value of the + LastTransitionTime for the status condition Type=Complete. + format: date-time + type: string + conditions: + description: |- + Conditions is a list of the latest, available observations of the + request's current state. + items: + description: "Condition contains details for one aspect of the current + state of this API Resource.\n---\nThis struct is intended for + direct use as an array at the field path .status.conditions. For + example,\n\n\n\ttype FooStatus struct{\n\t // Represents the + observations of a foo's current state.\n\t // Known .status.conditions.type + are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // + +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t + \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" + patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t + \ // other fields\n\t}" + 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 + imageName: + description: |- + ImageName is the name of the VirtualMachineImage resource that is + eventually realized in the same namespace as the VM and publication + request after the publication operation completes. + + + This field will not be set until the VirtualMachineImage resource + is realized. + type: string + lastAttemptTime: + description: LastAttemptTime represents the time when the latest request + was sent. + format: date-time + type: string + ready: + description: |- + Ready is set to true only when the VM has been published successfully + and the new VirtualMachineImage resource is ready. + + + Readiness is determined by waiting until there is status condition + Type=Complete and ensuring it and all other status conditions present + have a Status=True. The conditions present will be: + + + * SourceValid + * TargetValid + * Uploaded + * ImageAvailable + * Complete + type: boolean + sourceRef: + description: |- + SourceRef is the reference to the source of the publication request, + ex. a VirtualMachine resource. + properties: + apiVersion: + default: vmoperator.vmware.com/v1alpha1 + description: APIVersion is the API version of the referenced object. + type: string + kind: + default: VirtualMachine + description: Kind is the kind of referenced object. + type: string + name: + description: |- + Name is the name of the referenced object. + + + If omitted this value defaults to the name of the + VirtualMachinePublishRequest resource. + type: string + type: object + startTime: + description: |- + StartTime represents time when the request was acknowledged by the + controller. It is not guaranteed to be set in happens-before order + across separate operations. It is represented in RFC3339 form and is + in UTC. + format: date-time + type: string + targetRef: + description: |- + TargetRef is the reference to the target of the publication request, + ex. item information and a ContentLibrary resource. + properties: + item: + description: |- + Item contains information about the name of the object to which + the VM is published. + + Please note this value is optional and if omitted, the controller will use spec.source.name + "-image" as the name of the published item. diff --git a/config/crd/bases/vmoperator.vmware.com_virtualmachines.yaml b/config/crd/bases/vmoperator.vmware.com_virtualmachines.yaml index 4630d057a..afb1d647b 100644 --- a/config/crd/bases/vmoperator.vmware.com_virtualmachines.yaml +++ b/config/crd/bases/vmoperator.vmware.com_virtualmachines.yaml @@ -3097,6 +3097,2405 @@ spec: scheduled. + Please note this field may be empty when the cluster is not zone-aware. + type: string + type: object + type: object + served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .status.powerState + name: Power-State + type: string + - jsonPath: .spec.className + name: Class + priority: 1 + type: string + - jsonPath: .spec.imageName + name: Image + priority: 1 + type: string + - jsonPath: .status.network.primaryIP4 + name: Primary-IP4 + priority: 1 + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha3 + schema: + openAPIV3Schema: + description: |- + VirtualMachine is the schema for the virtualmachines API and represents the + desired state and observed status of a virtualmachines resource. + 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: VirtualMachineSpec defines the desired state of a VirtualMachine. + properties: + advanced: + description: Advanced describes a set of optional, advanced VM configuration + options. + properties: + bootDiskCapacity: + anyOf: + - type: integer + - type: string + description: |- + BootDiskCapacity is the capacity of the VM's boot disk -- the first disk + from the VirtualMachineImage from which the VM was deployed. + + + Please note it is not advised to change this value while the VM is + running. Also, resizing the VM's boot disk may require actions inside of + the guest to take advantage of the additional capacity. Finally, changing + the size of the VM's boot disk, even increasing it, could adversely + affect the VM. + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + changeBlockTracking: + description: |- + ChangeBlockTracking is a flag that enables incremental backup support + for this VM, a feature utilized by external backup systems such as + VMware Data Recovery. + type: boolean + defaultVolumeProvisioningMode: + description: |- + DefaultVolumeProvisioningMode specifies the default provisioning mode for + persistent volumes managed by this VM. + enum: + - Thin + - Thick + - ThickEagerZero + type: string + type: object + bootstrap: + description: |- + Bootstrap describes the desired state of the guest's bootstrap + configuration. + + + If omitted, a default bootstrap method may be selected based on the + guest OS identifier. If Linux, then the LinuxPrep method is used. + properties: + cloudInit: + description: |- + CloudInit may be used to bootstrap Linux guests with Cloud-Init or + Windows guests that support Cloudbase-Init. + + + The guest's networking stack is configured by Cloud-Init on Linux guests + and Cloudbase-Init on Windows guests. + + + Please note this bootstrap provider may not be used in conjunction with + the other bootstrap providers. + properties: + cloudConfig: + description: |- + CloudConfig describes a subset of a Cloud-Init CloudConfig, used to + bootstrap the VM. + + + Please note this field and RawCloudConfig are mutually exclusive. + properties: + defaultUserEnabled: + description: |- + DefaultUserEnabled may be set to true to ensure even if the Users field + is not empty, the default user is still created on systems that have one + defined. By default, Cloud-Init ignores the default user if the + CloudConfig provides one or more non-default users via the Users field. + type: boolean + runcmd: + description: |- + RunCmd allows running one or more commands on the guest. + The entries in this list can adhere to two, different formats: + + + Format 1 -- a string that contains the command and its arguments, ex. + + + runcmd: + - "ls -al" + + + Format 2 -- a list of the command and its arguments, ex. + + + runcmd: + - - echo + - "Hello, world." + x-kubernetes-preserve-unknown-fields: true + ssh_pwauth: + description: |- + SSHPwdAuth sets whether or not to accept password authentication. ``true`` will enable password + auth. ``false`` will disable. Default: leave the value unchanged. In order for this + config to be applied, SSH may need to be restarted. On systemd systems, this restart will + only happen if the SSH service has already been started. On non-systemd systems, a + restart will be attempted regardless of the service state. + type: boolean + timezone: + description: Timezone describes the timezone represented + in /usr/share/zoneinfo. + type: string + users: + description: Users allows adding/configuring one or more + users on the guest. + items: + description: User is a CloudConfig user data structure. + properties: + create_groups: + description: |- + CreateGroups is a flag that may be set to false to disable creation of + specified user groups. + + + Defaults to true when Name is not "default". + type: boolean + expiredate: + description: ExpireData is the date on which the + user's account will be disabled. + type: string + gecos: + description: |- + Gecos is an optional comment about the user, usually a comma-separated + string of the user's real name and contact information. + type: string + groups: + description: Groups is an optional list of groups + to add to the user. + items: + type: string + type: array + hashed_passwd: + description: |- + HashedPasswd is a hash of the user's password that will be applied even + if the specified user already exists. + properties: + key: + description: Key is the key in the secret that + specifies the requested data. + type: string + name: + description: Name is the name of the secret. + type: string + required: + - key + - name + type: object + homedir: + description: |- + Homedir is the optional home directory for the user. + + + Defaults to "/home/" when Name is not "default". + type: string + inactive: + description: |- + Inactive optionally represents the number of days until the user is + disabled. + format: int32 + type: integer + lock_passwd: + description: |- + LockPasswd disables password login. + + + Defaults to true when Name is not "default". + type: boolean + name: + description: |- + Name is the user's login name. + + + Please note this field may be set to the special value of "default" when + this User is the first element in the Users list from the CloudConfig. + When set to "default", all other fields from this User must be nil. + type: string + no_create_home: + description: |- + NoCreateHome prevents the creation of the home directory. + + + Defaults to false when Name is not "default". + type: boolean + no_log_init: + description: |- + NoLogInit prevents the initialization of lastlog and faillog for the + user. + + + Defaults to false when Name is not "default". + type: boolean + no_user_group: + description: |- + NoUserGroup prevents the creation of the group named after the user. + + + Defaults to false when Name is not "default". + type: boolean + passwd: + description: |- + Passwd is a hash of the user's password that will be applied only to + a newly created user. To apply a new, hashed password to an existing user + please use HashedPasswd instead. + properties: + key: + description: Key is the key in the secret that + specifies the requested data. + type: string + name: + description: Name is the name of the secret. + type: string + required: + - key + - name + type: object + primary_group: + description: |- + PrimaryGroup is the primary group for the user. + + + Defaults to the value of the Name field when it is not "default". + type: string + selinux_user: + description: SELinuxUser is the SELinux user for + the user's login. + type: string + shell: + description: |- + Shell is the path to the user's login shell. + + + Please note the default is to set no shell, which results in a + system-specific default being used. + type: string + snapuser: + description: |- + SnapUser specifies an e-mail address to create the user as a Snappy user + through "snap create-user". + + + If an Ubuntu SSO account is associated with the address, the username and + SSH keys will be requested from there. + type: string + ssh_authorized_keys: + description: |- + SSHAuthorizedKeys is a list of SSH keys to add to the user's authorized + keys file. + + + Please note this field may not be combined with SSHRedirectUser. + items: + type: string + type: array + ssh_import_id: + description: |- + SSHImportID is a list of SSH IDs to import for the user. + + + Please note this field may not be combined with SSHRedirectUser. + items: + type: string + type: array + ssh_redirect_user: + description: |- + SSHRedirectUser may be set to true to disable SSH logins for this user. + + + Please note that when specified, all SSH keys from cloud meta-data will + be configured in a disabled state for this user. Any SSH login as this + user will timeout with a message to login instead as the default user. + + + This field may not be combined with SSHAuthorizedKeys or SSHImportID. + + + Defaults to false when Name is not "default". + type: boolean + sudo: + description: |- + Sudo is a sudo rule to apply to the user. + + + When omitted, no sudo rules will be applied to the user. + type: string + system: + description: |- + System is an optional flag that indicates the user should be created as + a system user with no home directory. + + + Defaults to false when Name is not "default". + type: boolean + uid: + description: |- + UID is the user's ID. + + + When omitted the guest will default to the next available number. + format: int64 + type: integer + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + write_files: + description: WriteFiles + items: + description: |- + WriteFile is a CloudConfig + write_file data structure. + properties: + append: + description: |- + Append specifies whether or not to append the content to an existing file + if the file specified by Path already exists. + type: boolean + content: + description: |- + Content is the optional content to write to the provided Path. + + + When omitted an empty file will be created or existing file will be + modified. + + + The value for this field can adhere to two, different formats: + + + Format 1 -- a string that contains the command and its arguments, ex. + + + content: Hello, world. + + + Please note that format 1 supports all of the manners of specifying a + YAML string. + + + Format 2 -- a secret reference with the name of the key that contains + the content for the file, ex. + + + content: + name: my-bootstrap-secret + key: my-file-content + x-kubernetes-preserve-unknown-fields: true + defer: + description: |- + Defer indicates to defer writing the file until Cloud-Init's "final" + stage, after users are created and packages are installed. + type: boolean + encoding: + default: text/plain + description: Encoding is an optional encoding type + of the content. + enum: + - b64 + - base64 + - gz + - gzip + - gz+b64 + - gz+base64 + - gzip+b64 + - gzip+base64 + - text/plain + type: string + owner: + default: root:root + description: Owner is an optional "owner:group" + to chown the file. + type: string + path: + description: Path is the path of the file to which + the content is decoded and written. + type: string + permissions: + default: "0644" + description: |- + Permissions an optional set of file permissions to set. + + + Please note the permissions should be specified as an octal string, ex. + "0###". + + + When omitted the guest will default this value to "0644". + type: string + required: + - path + type: object + type: array + x-kubernetes-list-map-keys: + - path + x-kubernetes-list-type: map + type: object + rawCloudConfig: + description: |- + RawCloudConfig describes a key in a Secret resource that contains the + CloudConfig data used to bootstrap the VM. + + + The CloudConfig data specified by the key may be plain-text, + base64-encoded, or gzipped and base64-encoded. + + + Please note this field and CloudConfig are mutually exclusive. + properties: + key: + description: Key is the key in the secret that specifies + the requested data. + type: string + name: + description: Name is the name of the secret. + type: string + required: + - key + - name + type: object + sshAuthorizedKeys: + description: |- + SSHAuthorizedKeys is a list of public keys that CloudInit will apply to + the guest's default user. + items: + type: string + type: array + type: object + linuxPrep: + description: |- + LinuxPrep may be used to bootstrap Linux guests. + + + The guest's networking stack is configured by Guest OS Customization + (GOSC). + + + Please note this bootstrap provider may be used in conjunction with the + VAppConfig bootstrap provider when wanting to configure the guest's + network with GOSC but also send vApp/OVF properties into the guest. + + + This bootstrap provider may not be used in conjunction with the CloudInit + or Sysprep bootstrap providers. + properties: + hardwareClockIsUTC: + description: |- + HardwareClockIsUTC specifies whether the hardware clock is in UTC or + local time. + type: boolean + timeZone: + description: |- + TimeZone is a case-sensitive timezone, such as Europe/Sofia. + + + Valid values are based on the tz (timezone) database used by Linux and + other Unix systems. The values are strings in the form of + "Area/Location," in which Area is a continent or ocean name, and + Location is the city, island, or other regional designation. + + + Please see https://kb.vmware.com/s/article/2145518 for a list of valid + time zones for Linux systems. + type: string + type: object + sysprep: + description: |- + Sysprep may be used to bootstrap Windows guests. + + + The guest's networking stack is configured by Guest OS Customization + (GOSC). + + + Please note this bootstrap provider may be used in conjunction with the + VAppConfig bootstrap provider when wanting to configure the guest's + network with GOSC but also send vApp/OVF properties into the guest. + + + This bootstrap provider may not be used in conjunction with the CloudInit + or LinuxPrep bootstrap providers. + properties: + rawSysprep: + description: |- + RawSysprep describes a key in a Secret resource that contains an XML + string of the Sysprep text used to bootstrap the VM. + + + The data specified by the Secret key may be plain-text, base64-encoded, + or gzipped and base64-encoded. + + + Please note this field and Sysprep are mutually exclusive. + properties: + key: + description: Key is the key in the secret that specifies + the requested data. + type: string + name: + description: Name is the name of the secret. + type: string + required: + - key + - name + type: object + sysprep: + description: |- + Sysprep is an object representation of a Windows sysprep.xml answer file. + + + This field encloses all the individual keys listed in a sysprep.xml file. + + + For more detailed information please see + https://technet.microsoft.com/en-us/library/cc771830(v=ws.10).aspx. + + + Please note this field and RawSysprep are mutually exclusive. + properties: + guiRunOnce: + description: GUIRunOnce is a representation of the Sysprep + GuiRunOnce key. + properties: + commands: + description: |- + Commands is a list of commands to run at first user logon, after guest + customization. + items: + type: string + type: array + type: object + guiUnattended: + description: GUIUnattended is a representation of the + Sysprep GUIUnattended key. + properties: + autoLogon: + description: |- + AutoLogon determine whether the machine automatically logs on as + Administrator. + + + Please note if AutoLogon is true, then Password must be set or guest + customization will fail. + type: boolean + autoLogonCount: + description: |- + AutoLogonCount specifies the number of times the machine should + automatically log on as Administrator. + + + Generally it should be 1, but if your setup requires a number of reboots, + you may want to increase it. This number may be determined by the list of + commands executed by the GuiRunOnce command. + + + Please note this field must be specified with a non-zero positive integer if AutoLogon is true. + format: int32 + type: integer + password: + description: |- + Password is the new administrator password for the machine. + + + To specify that the password should be set to blank (that is, no + password), set the password value to NULL. Because of encryption, "" is + NOT a valid value. + + + Please note if the password is set to blank and AutoLogon is true, the + guest customization will fail. + + + If the XML file is generated by the VirtualCenter Customization Wizard, + then the password is encrypted. Otherwise, the client should set the + plainText attribute to true, so that the customization process does not + attempt to decrypt the string. + + + When not explicitly specified, the Key field for the selector defaults to + `password`. + properties: + key: + default: password + description: Key is the key in the secret that + specifies the requested data. + type: string + name: + description: Name is the name of the secret. + type: string + required: + - key + - name + type: object + timeZone: + description: |- + TimeZone is the time zone index for the virtual machine. + + + Please note that numbers correspond to time zones listed at + https://bit.ly/3Rzv8oL. + format: int32 + type: integer + type: object + identification: + description: Identification is a representation of the + Sysprep Identification key. + properties: + domainAdmin: + description: |- + DomainAdmin is the domain user account used for authentication if the + virtual machine is joining a domain. The user does not need to be a + domain administrator, but the account must have the privileges required + to add computers to the domain. + type: string + domainAdminPassword: + description: |- + DomainAdminPassword is the password for the domain user account used for + authentication if the virtual machine is joining a domain. + + + When not explicitly specified, the Key field for the selector defaults to + `domain_admin_password`. + properties: + key: + default: domain_admin_password + description: Key is the key in the secret that + specifies the requested data. + type: string + name: + description: Name is the name of the secret. + type: string + required: + - key + - name + type: object + joinDomain: + description: |- + JoinDomain is the domain that the virtual machine should join. If this + value is supplied, then DomainAdmin and DomainAdminPassword must also be + supplied, and the JoinWorkgroup name must be empty. + type: string + joinWorkgroup: + description: |- + JoinWorkgroup is the workgroup that the virtual machine should join. If + this value is supplied, then the JoinDomain and the authentication fields + (DomainAdmin and DomainAdminPassword) must be empty. + type: string + type: object + licenseFilePrintData: + description: |- + LicenseFilePrintData is a representation of the Sysprep + LicenseFilePrintData key. + + + Please note this is required only for Windows 2000 Server and Windows + Server 2003. + properties: + autoMode: + description: AutoMode specifies the server licensing + mode. + enum: + - perSeat + - perServer + type: string + autoUsers: + description: |- + AutoUsers indicates the number of client licenses purchased for the + VirtualCenter server being installed. + + + Please note this value is ignored unless AutoMode is PerServer. + format: int32 + type: integer + required: + - autoMode + type: object + userData: + description: UserData is a representation of the Sysprep + UserData key. + properties: + fullName: + description: FullName is the user's full name. + type: string + orgName: + description: OrgName is the name of the user's organization. + type: string + productID: + description: |- + ProductID is a valid serial number. + + + Please note unless the VirtualMachineImage was installed with a volume + license key, ProductID must be set or guest customization will fail. + + + When not explicitly specified, the Key field for the selector defaults to + `domain_admin_password`. + properties: + key: + default: product_id + description: Key is the key in the secret that + specifies the requested data. + type: string + name: + description: Name is the name of the secret. + type: string + required: + - key + - name + type: object + required: + - fullName + - orgName + type: object + required: + - userData + type: object + type: object + vAppConfig: + description: |- + VAppConfig may be used to bootstrap guests that rely on vApp properties + (how VMware surfaces OVF properties on guests) to transport data into the + guest. + + + The guest's networking stack may be configured using either vApp + properties or GOSC. + + + Many OVFs define one or more properties that are used by the guest to + bootstrap its networking stack. If the VirtualMachineImage defines one or + more properties like this, then they can be configured to use the network + data provided for this VM at runtime by setting these properties to Go + template strings. + + + It is also possible to use GOSC to bootstrap this VM's network stack by + configuring either the LinuxPrep or Sysprep bootstrap providers. + + + Please note the VAppConfig bootstrap provider in conjunction with the + LinuxPrep bootstrap provider is the equivalent of setting the v1alpha1 + VM metadata transport to "OvfEnv". + + + This bootstrap provider may not be used in conjunction with the CloudInit + bootstrap provider. + properties: + properties: + description: |- + Properties is a list of vApp/OVF property key/value pairs. + + + Please note this field and RawProperties are mutually exclusive. + items: + description: |- + KeyValueOrSecretKeySelectorPair is useful when wanting to realize a map as a + list of key/value pairs where each value could also reference data stored in + a Secret resource. + properties: + key: + description: Key is the key part of the key/value pair. + type: string + value: + description: Value is the optional value part of the + key/value pair. + properties: + from: + description: |- + From is specified to reference a value from a Secret resource. + + + Please note this field is mutually exclusive with the Value field. + properties: + key: + description: Key is the key in the secret that + specifies the requested data. + type: string + name: + description: Name is the name of the secret. + type: string + required: + - key + - name + type: object + value: + description: |- + Value is used to directly specify a value. + + + Please note this field is mutually exclusive with the From field. + type: string + type: object + required: + - key + type: object + type: array + x-kubernetes-list-map-keys: + - key + x-kubernetes-list-type: map + rawProperties: + description: |- + RawProperties is the name of a Secret resource in the same Namespace as + this VM where each key/value pair from the Secret is used as a vApp + key/value pair. + + + Please note this field and Properties are mutually exclusive. + type: string + type: object + type: object + className: + description: |- + ClassName describes the name of the VirtualMachineClass resource used to + deploy this VM. + type: string + imageName: + description: |- + ImageName describes the name of the image resource used to deploy this + VM. + + + This field may be used to specify the name of a VirtualMachineImage + or ClusterVirtualMachineImage resource. The resolver first checks to see + if there is a VirtualMachineImage with the specified name. If no + such resource exists, the resolver then checks to see if there is a + ClusterVirtualMachineImage resource with the specified name in the same + Namespace as the VM being deployed. + + + This field may also be used to specify the display name (vSphere name) of + a VirtualMachineImage or ClusterVirtualMachineImage resource. If the + display name unambiguously resolves to a distinct VM image (among all + existing VirtualMachineImages in the VM's namespace and all existing + ClusterVirtualMachineImages), then a mutation webhook updates this field + with the VM image resource name. If the display name resolves to multiple + or no VM images, then the mutation webhook denies the request and outputs + an error message accordingly. + type: string + minHardwareVersion: + description: |- + MinHardwareVersion describes the desired, minimum hardware version. + + + The logic that determines the hardware version is as follows: + + + 1. If this field is set, then its value is used. + 2. Otherwise, if the VirtualMachineClass used to deploy the VM contains a + non-empty hardware version, then it is used. + 3. Finally, if the hardware version is still undetermined, the value is + set to the default hardware version for the Datacenter/Cluster/Host + where the VM is provisioned. + + + This field is never updated to reflect the derived hardware version. + Instead, VirtualMachineStatus.HardwareVersion surfaces + the observed hardware version. + + + Please note, setting this field's value to N ensures a VM's hardware + version is equal to or greater than N. For example, if a VM's observed + hardware version is 10 and this field's value is 13, then the VM will be + upgraded to hardware version 13. However, if the observed hardware + version is 17 and this field's value is 13, no change will occur. + + + Several features are hardware version dependent, for example: + + + * NVMe Controllers >= 14 + * Dynamic Direct Path I/O devices >= 17 + + + Please refer to https://kb.vmware.com/s/article/1003746 for a list of VM + hardware versions. + + + It is important to remember that a VM's hardware version may not be + downgraded and upgrading a VM deployed from an image based on an older + hardware version to a more recent one may result in unpredictable + behavior. In other words, please be careful when choosing to upgrade a + VM to a newer hardware version. + format: int32 + minimum: 13 + type: integer + network: + description: |- + Network describes the desired network configuration for the VM. + + + Please note this value may be omitted entirely and the VM will be + assigned a single, virtual network interface that is connected to the + Namespace's default network. + properties: + disabled: + description: |- + Disabled is a flag that indicates whether or not to disable networking + for this VM. + + + When set to true, the VM is not configured with a default interface nor + any specified from the Interfaces field. + type: boolean + hostName: + description: |- + HostName is the value the guest uses as its host name. + If omitted then the name of the VM will be used. + + + Please note this feature is available only with the following bootstrap + providers: CloudInit, LinuxPrep, and Sysprep (except for RawSysprep). + + + When the bootstrap provider is Sysprep (except for RawSysprep) this is + used as the Computer Name. + type: string + interfaces: + description: |- + Interfaces is the list of network interfaces used by this VM. + + + If the Interfaces field is empty and the Disabled field is false, then + a default interface with the name eth0 will be created. + + + The maximum number of network interface allowed is 10 because of the limit + built into vSphere. + items: + description: |- + VirtualMachineNetworkInterfaceSpec describes the desired state of a VM's + network interface. + properties: + addresses: + description: |- + Addresses is an optional list of IP4 or IP6 addresses to assign to this + interface. + + + Please note this field is only supported if the connected network + supports manual IP allocation. + + + Please note IP4 and IP6 addresses must include the network prefix length, + ex. 192.168.0.10/24 or 2001:db8:101::a/64. + + + Please note this field may not contain IP4 addresses if DHCP4 is set + to true or IP6 addresses if DHCP6 is set to true. + + + Please note if the Interfaces field is non-empty then this field is + ignored and should be specified on the elements in the Interfaces list. + items: + type: string + type: array + dhcp4: + description: |- + DHCP4 indicates whether or not this interface uses DHCP for IP4 + networking. + + + Please note this field is only supported if the network connection + supports DHCP. + + + Please note this field is mutually exclusive with IP4 addresses in the + Addresses field and the Gateway4 field. + type: boolean + dhcp6: + description: |- + DHCP6 indicates whether or not this interface uses DHCP for IP6 + networking. + + + Please note this field is only supported if the network connection + supports DHCP. + + + Please note this field is mutually exclusive with IP6 addresses in the + Addresses field and the Gateway6 field. + type: boolean + gateway4: + description: |- + Gateway4 is the default, IP4 gateway for this interface. + + + Please note this field is only supported if the network connection + supports manual IP allocation. + + + If the network connection supports manual IP allocation and the + Addresses field includes at least one IP4 address, then this field + is required. + + + Please note the IP address must include the network prefix length, ex. + 192.168.0.1/24. + + + Please note this field is mutually exclusive with DHCP4. + type: string + gateway6: + description: |- + Gateway6 is the primary IP6 gateway for this interface. + + + Please note this field is only supported if the network connection + supports manual IP allocation. + + + If the network connection supports manual IP allocation and the + Addresses field includes at least one IP6 address, then this field + is required. + + + Please note the IP address must include the network prefix length, ex. + 2001:db8:101::1/64. + + + Please note this field is mutually exclusive with DHCP6. + type: string + guestDeviceName: + description: |- + GuestDeviceName is used to rename the device inside the guest when the + bootstrap provider is Cloud-Init. Please note it is up to the user to + ensure the provided device name does not conflict with any other devices + inside the guest, ex. dvd, cdrom, sda, etc. + pattern: ^\w\w+$ + type: string + mtu: + description: |- + MTU is the Maximum Transmission Unit size in bytes. + + + Please note this feature is available only with the following bootstrap + providers: CloudInit. + format: int64 + type: integer + name: + description: |- + Name describes the unique name of this network interface, used to + distinguish it from other network interfaces attached to this VM. + + + When the bootstrap provider is Cloud-Init and GuestDeviceName is not + specified, the device inside the guest will be renamed to this value. + Please note it is up to the user to ensure the provided name does not + conflict with any other devices inside the guest, ex. dvd, cdrom, sda, etc. + pattern: ^[a-z0-9]{2,}$ + type: string + nameservers: + description: |- + Nameservers is a list of IP4 and/or IP6 addresses used as DNS + nameservers. + + + Please note this feature is available only with the following bootstrap + providers: CloudInit and Sysprep. + + + Please note that Linux allows only three nameservers + (https://linux.die.net/man/5/resolv.conf). + items: + type: string + type: array + network: + description: |- + Network is the name of the network resource to which this interface is + connected. + + + If no network is provided, then this interface will be connected to the + Namespace's default network. + 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 + 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: + - name + type: object + routes: + description: |- + Routes is a list of optional, static routes. + + + Please note this feature is available only with the following bootstrap + providers: CloudInit. + items: + description: VirtualMachineNetworkRouteSpec defines a + static route for a guest. + properties: + metric: + description: Metric is the weight/priority of the + route. + format: int32 + type: integer + to: + description: To is an IP4 or IP6 address. + type: string + via: + description: Via is an IP4 or IP6 address. + type: string + required: + - metric + - to + - via + type: object + type: array + searchDomains: + description: |- + SearchDomains is a list of search domains used when resolving IP + addresses with DNS. + + + Please note this feature is available only with the following bootstrap + providers: CloudInit. + items: + type: string + type: array + required: + - name + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + nameservers: + description: |- + Nameservers is a list of IP4 and/or IP6 addresses used as DNS + nameservers. These are applied globally. + + + Please note global nameservers are only available with the following + bootstrap providers: LinuxPrep and Sysprep. The Cloud-Init bootstrap + provider supports per-interface nameservers. + + + Please note that Linux allows only three nameservers + (https://linux.die.net/man/5/resolv.conf). + items: + type: string + type: array + searchDomains: + description: |- + SearchDomains is a list of search domains used when resolving IP + addresses with DNS. These are applied globally. + + + Please note global search domains are only available with the following + bootstrap providers: LinuxPrep and Sysprep. The Cloud-Init bootstrap + provider supports per-interface search domains. + items: + type: string + type: array + type: object + nextRestartTime: + description: |- + NextRestartTime may be used to restart the VM, in accordance with + RestartMode, by setting the value of this field to "now" + (case-insensitive). + + + A mutating webhook changes this value to the current time (UTC), which + the VM controller then uses to determine the VM should be restarted by + comparing the value to the timestamp of the last time the VM was + restarted. + + + Please note it is not possible to schedule future restarts using this + field. The only value that users may set is the string "now" + (case-insensitive). + type: string + powerOffMode: + default: TrySoft + description: |- + PowerOffMode describes the desired behavior when powering off a VM. + + + There are three, supported power off modes: Hard, Soft, and + TrySoft. The first mode, Hard, is the equivalent of a physical + system's power cord being ripped from the wall. The Soft mode + requires the VM's guest to have VM Tools installed and attempts to + gracefully shutdown the VM. Its variant, TrySoft, first attempts + a graceful shutdown, and if that fails or the VM is not in a powered off + state after five minutes, the VM is halted. + + + If omitted, the mode defaults to TrySoft. + enum: + - Hard + - Soft + - TrySoft + type: string + powerState: + description: |- + PowerState describes the desired power state of a VirtualMachine. + + + Please note this field may be omitted when creating a new VM and will + default to "PoweredOn." However, once the field is set to a non-empty + value, it may no longer be set to an empty value. + + + Additionally, setting this value to "Suspended" is not supported when + creating a new VM. The valid values when creating a new VM are + "PoweredOn" and "PoweredOff." An empty value is also allowed on create + since this value defaults to "PoweredOn" for new VMs. + enum: + - PoweredOff + - PoweredOn + - Suspended + type: string + readinessProbe: + description: ReadinessProbe describes a probe used to determine the + VM's ready state. + properties: + guestHeartbeat: + description: GuestHeartbeat specifies an action involving the + guest heartbeat status. + properties: + thresholdStatus: + default: green + description: |- + ThresholdStatus is the value that the guest heartbeat status must be at or above to be + considered successful. + enum: + - yellow + - green + type: string + type: object + guestInfo: + description: |- + GuestInfo specifies an action involving key/value pairs from GuestInfo. + + + The elements are evaluated with the logical AND operator, meaning + all expressions must evaluate as true for the probe to succeed. + + + For example, a VM resource's probe definition could be specified as the + following: + + + guestInfo: + - key: ready + value: true + + + With the above configuration in place, the VM would not be considered + ready until the GuestInfo key "ready" was set to the value "true". + + + From within the guest operating system it is possible to set GuestInfo + key/value pairs using the program "vmware-rpctool," which is included + with VM Tools. For example, the following command will set the key + "guestinfo.ready" to the value "true": + + + vmware-rpctool "info-set guestinfo.ready true" + + + Once executed, the VM's readiness probe will be signaled and the + VM resource will be marked as ready. + items: + description: |- + GuestInfoAction describes a key from GuestInfo that must match the associated + value expression. + properties: + key: + description: |- + Key is the name of the GuestInfo key. + + + The key is automatically prefixed with "guestinfo." before being + evaluated. Thus if the key "guestinfo.mykey" is provided, it will be + evaluated as "guestinfo.guestinfo.mykey". + type: string + value: + description: |- + Value is a regular expression that is matched against the value of the + specified key. + + + An empty value is the equivalent of "match any" or ".*". + + + All values must adhere to the RE2 regular expression syntax as documented + at https://golang.org/s/re2syntax. Invalid values may be rejected or + ignored depending on the implementation of this API. Either way, invalid + values will not be considered when evaluating the ready state of a VM. + type: string + required: + - key + type: object + type: array + periodSeconds: + description: |- + PeriodSeconds specifics how often (in seconds) to perform the probe. + Defaults to 10 seconds. Minimum value is 1. + format: int32 + minimum: 1 + type: integer + tcpSocket: + description: |- + TCPSocket specifies an action involving a TCP port. + + + Deprecated: The TCPSocket action requires network connectivity that is not supported in all environments. + This field will be removed in a later API version. + properties: + host: + description: Host is an optional host name to connect to. + Host defaults to the VM IP. + type: string + port: + anyOf: + - type: integer + - type: string + description: |- + Port specifies a number or name of the port to access on the VM. + If the format of port is a number, it must be in the range 1 to 65535. + If the format of name is a string, it must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + timeoutSeconds: + description: |- + TimeoutSeconds specifies a number of seconds after which the probe times out. + Defaults to 10 seconds. Minimum value is 1. + format: int32 + maximum: 60 + minimum: 1 + type: integer + type: object + reserved: + description: |- + Reserved describes a set of VM configuration options reserved for system + use. + + + Please note attempts to modify the value of this field by a DevOps user + will result in a validation error. + properties: + resourcePolicyName: + description: |- + ResourcePolicyName describes the name of a + VirtualMachineSetResourcePolicy resource used to configure the VM's + resource policy. + type: string + type: object + restartMode: + default: TrySoft + description: |- + RestartMode describes the desired behavior for restarting a VM when + spec.nextRestartTime is set to "now" (case-insensitive). + + + There are three, supported suspend modes: Hard, Soft, and + TrySoft. The first mode, Hard, is where vSphere resets the VM without any + interaction inside of the guest. The Soft mode requires the VM's guest to + have VM Tools installed and asks the guest to restart the VM. Its + variant, TrySoft, first attempts a soft restart, and if that fails or + does not complete within five minutes, the VM is hard reset. + + + If omitted, the mode defaults to TrySoft. + enum: + - Hard + - Soft + - TrySoft + type: string + storageClass: + description: |- + StorageClass describes the name of a Kubernetes StorageClass resource + used to configure this VM's storage-related attributes. + + + Please see https://kubernetes.io/docs/concepts/storage/storage-classes/ + for more information on Kubernetes storage classes. + type: string + suspendMode: + default: TrySoft + description: |- + SuspendMode describes the desired behavior when suspending a VM. + + + There are three, supported suspend modes: Hard, Soft, and + TrySoft. The first mode, Hard, is where vSphere suspends the VM to + disk without any interaction inside of the guest. The Soft mode + requires the VM's guest to have VM Tools installed and attempts to + gracefully suspend the VM. Its variant, TrySoft, first attempts + a graceful suspend, and if that fails or the VM is not in a put into + standby by the guest after five minutes, the VM is suspended. + + + If omitted, the mode defaults to TrySoft. + enum: + - Hard + - Soft + - TrySoft + type: string + volumes: + description: Volumes describes a list of volumes that can be mounted + to the VM. + items: + description: VirtualMachineVolume represents a named volume in a + VM. + properties: + name: + description: |- + Name represents the volume's name. Must be a DNS_LABEL and unique within + the VM. + type: string + persistentVolumeClaim: + description: |- + PersistentVolumeClaim represents a reference to a PersistentVolumeClaim + in the same namespace. + + + More information is available at + https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims. + properties: + claimName: + description: |- + claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + type: string + instanceVolumeClaim: + description: InstanceVolumeClaim is set if the PVC is backed + by instance storage. + properties: + size: + anyOf: + - type: integer + - type: string + description: Size is the size of the requested instance + storage volume. + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + storageClass: + description: |- + StorageClass is the name of the Kubernetes StorageClass that provides + the backing storage for this instance storage volume. + type: string + required: + - size + - storageClass + type: object + readOnly: + description: |- + readOnly Will force the ReadOnly setting in VolumeMounts. + Default false. + type: boolean + required: + - claimName + type: object + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + type: object + status: + description: VirtualMachineStatus defines the observed state of a VirtualMachine + instance. + properties: + biosUUID: + description: |- + BiosUUID describes a unique identifier provided by the underlying + infrastructure provider that is exposed to the Guest OS BIOS as a unique + hardware identifier. + type: string + changeBlockTracking: + description: ChangeBlockTracking describes the CBT enablement status + on the VM. + type: boolean + class: + description: |- + Class is a reference to the VirtualMachineClass resource used to deploy + this VM. + 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 + conditions: + description: Conditions describes the observed conditions of the VirtualMachine. + items: + description: "Condition contains details for one aspect of the current + state of this API Resource.\n---\nThis struct is intended for + direct use as an array at the field path .status.conditions. For + example,\n\n\n\ttype FooStatus struct{\n\t // Represents the + observations of a foo's current state.\n\t // Known .status.conditions.type + are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // + +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t + \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" + patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t + \ // other fields\n\t}" + 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 + hardwareVersion: + description: |- + HardwareVersion describes the VirtualMachine resource's observed + hardware version. + + + Please refer to VirtualMachineSpec.MinHardwareVersion for more + information on the topic of a VM's hardware version. + format: int32 + type: integer + host: + description: |- + Host describes the hostname or IP address of the infrastructure host + where the VM is executed. + type: string + image: + description: |- + Image is a reference to the VirtualMachineImage resource used to deploy + this VM. + 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 + instanceUUID: + description: |- + InstanceUUID describes the unique instance UUID provided by the + underlying infrastructure provider, such as vSphere. + type: string + lastRestartTime: + description: LastRestartTime describes the last time the VM was restarted. + format: date-time + type: string + network: + description: |- + Network describes the observed state of the VM's network configuration. + Please note much of the network status information is only available if + the guest has VM Tools installed. + properties: + config: + description: |- + Config describes the resolved, configured network settings for the VM, + such as an interface's IP address obtained from IPAM, or global DNS + settings. + + + Please note this information does *not* represent the *observed* network + state of the VM, but is intended for situations where someone boots a VM + with no appropriate bootstrap engine and needs to know the network config + valid for the deployed VM. + properties: + dns: + description: DNS describes the configured state of client-side + DNS. + properties: + hostName: + description: |- + HostName is the host name portion of the DNS name. For example, + the "my-vm" part of "my-vm.domain.local". + type: string + nameservers: + description: |- + Nameservers is a list of the IP addresses for the DNS servers to use. + + + IP4 addresses are specified using dotted decimal notation. For example, + "192.0.2.1". + + + IP6 addresses are 128-bit addresses represented as eight fields of up to + four hexadecimal digits. A colon separates each field (:). For example, + 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of the + symbol '::' to represent multiple 16-bit groups of contiguous 0's only + once in an address as described in RFC 2373. + items: + type: string + type: array + searchDomains: + description: |- + SearchDomains is a list of domains in which to search for hosts, in the + order of preference. + items: + type: string + type: array + type: object + interfaces: + description: Interfaces describes the configured state of + the network interfaces. + items: + description: |- + VirtualMachineNetworkConfigInterfaceStatus describes the configured state of + network interface. + properties: + dns: + description: DNS describes the interface's configured + DNS information. + properties: + hostName: + description: |- + HostName is the host name portion of the DNS name. For example, + the "my-vm" part of "my-vm.domain.local". + type: string + nameservers: + description: |- + Nameservers is a list of the IP addresses for the DNS servers to use. + + + IP4 addresses are specified using dotted decimal notation. For example, + "192.0.2.1". + + + IP6 addresses are 128-bit addresses represented as eight fields of up to + four hexadecimal digits. A colon separates each field (:). For example, + 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of the + symbol '::' to represent multiple 16-bit groups of contiguous 0's only + once in an address as described in RFC 2373. + items: + type: string + type: array + searchDomains: + description: |- + SearchDomains is a list of domains in which to search for hosts, in the + order of preference. + items: + type: string + type: array + type: object + ip: + description: IP describes the interface's configured + IP information. + properties: + addresses: + description: |- + Addresses describes configured IP addresses for this interface. + Addresses include the network's prefix length, ex. 192.168.0.0/24 or + 2001:DB8:101::230:6eff:fe04:d9ff::/64. + items: + type: string + type: array + dhcp: + description: DHCP describes the interface's configured + DHCP options. + properties: + ip4: + description: IP4 describes the configured state + of the IP4 DHCP settings. + properties: + enabled: + description: Enabled describes whether DHCP + is enabled. + type: boolean + type: object + ip6: + description: IP6 describes the configured state + of the IP6 DHCP settings. + properties: + enabled: + description: Enabled describes whether DHCP + is enabled. + type: boolean + type: object + type: object + gateway4: + description: |- + Gateway4 describes the interface's configured, default, IP4 gateway. + + + Please note the IP address include the network prefix length, ex. + 192.168.0.1/24. + type: string + gateway6: + description: |- + Gateway6 describes the interface's configured, default, IP6 gateway. + + + Please note the IP address includes the network prefix length, ex. + 2001:db8:101::1/64. + type: string + type: object + name: + description: |- + Name describes the corresponding network interface with the same name + in the VM's desired network interface list. + + + Please note this name is not necessarily related to the name of the + device as it is surfaced inside of the guest. + type: string + required: + - name + type: object + type: array + type: object + interfaces: + description: Interfaces describes the status of the VM's network + interfaces. + items: + description: |- + VirtualMachineNetworkInterfaceStatus describes the observed state of a + VM's network interface. + properties: + deviceKey: + description: |- + DeviceKey describes the unique hardware device key of this network + interface. + format: int32 + type: integer + dns: + description: DNS describes the observed state of the interface's + DNS configuration. + properties: + dhcp: + description: |- + DHCP indicates whether or not dynamic host control protocol (DHCP) was + used to configure DNS configuration. + type: boolean + domainName: + description: |- + DomainName is the domain name portion of the DNS name. For example, + the "domain.local" part of "my-vm.domain.local". + type: string + hostName: + description: |- + HostName is the host name portion of the DNS name. For example, + the "my-vm" part of "my-vm.domain.local". + type: string + nameservers: + description: |- + Nameservers is a list of the IP addresses for the DNS servers to use. + + + IP4 addresses are specified using dotted decimal notation. For example, + "192.0.2.1". + + + IP6 addresses are 128-bit addresses represented as eight fields of up to + four hexadecimal digits. A colon separates each field (:). For example, + 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of the + symbol '::' to represent multiple 16-bit groups of contiguous 0's only + once in an address as described in RFC 2373. + items: + type: string + type: array + searchDomains: + description: |- + SearchDomains is a list of domains in which to search for hosts, in the + order of preference. + items: + type: string + type: array + type: object + ip: + description: IP describes the observed state of the interface's + IP configuration. + properties: + addresses: + description: Addresses describes observed IP addresses + for this interface. + items: + description: |- + VirtualMachineNetworkInterfaceIPAddrStatus describes information about a + specific IP address. + properties: + address: + description: |- + Address is an IP4 or IP6 address and their network prefix length. + + + An IP4 address is specified using dotted decimal notation. For example, + "192.0.2.1". + + + IP6 addresses are 128-bit addresses represented as eight fields of up to + four hexadecimal digits. A colon separates each field (:). For example, + 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of the + symbol '::' to represent multiple 16-bit groups of contiguous 0's only + once in an address as described in RFC 2373. + type: string + lifetime: + description: Lifetime describes when this address + will expire. + format: date-time + type: string + origin: + description: Origin describes how this address + was configured. + enum: + - dhcp + - linklayer + - manual + - other + - random + type: string + state: + description: State describes the state of this + IP address. + enum: + - deprecated + - duplicate + - inaccessible + - invalid + - preferred + - tentative + - unknown + type: string + required: + - address + type: object + type: array + autoConfigurationEnabled: + description: |- + AutoConfigurationEnabled describes whether or not ICMPv6 router + solicitation requests are enabled or disabled from a given interface. + + + These requests acquire an IP6 address and default gateway route from + zero-to-many routers on the connected network. + + + If not set then ICMPv6 is not available on this VM. + type: boolean + dhcp: + description: |- + DHCP describes the VM's observed, client-side, interface-specific DHCP + options. + properties: + ip4: + description: IP4 describes the observed state of + the IP4 DHCP client settings. + properties: + config: + description: |- + Config describes platform-dependent settings for the DHCP client. + + + The key part is a unique number while the value part is the platform + specific configuration command. For example on Linux and BSD systems + using the file dhclient.conf output would be reported at system scope: + key='1', value='timeout 60;' key='2', value='reboot 10;'. The output + reported per interface would be: + key='1', value='prepend domain-name-servers 192.0.2.1;' + key='2', value='require subnet-mask, domain-name-servers;'. + items: + description: |- + KeyValuePair is useful when wanting to realize a map as a list of key/value + pairs. + properties: + key: + description: Key is the key part of the + key/value pair. + type: string + value: + description: Value is the optional value + part of the key/value pair. + type: string + required: + - key + type: object + type: array + x-kubernetes-list-map-keys: + - key + x-kubernetes-list-type: map + enabled: + description: Enabled reports the status of the + DHCP client services. + type: boolean + type: object + ip6: + description: IP6 describes the observed state of + the IP6 DHCP client settings. + properties: + config: + description: |- + Config describes platform-dependent settings for the DHCP client. + + + The key part is a unique number while the value part is the platform + specific configuration command. For example on Linux and BSD systems + using the file dhclient.conf output would be reported at system scope: + key='1', value='timeout 60;' key='2', value='reboot 10;'. The output + reported per interface would be: + key='1', value='prepend domain-name-servers 192.0.2.1;' + key='2', value='require subnet-mask, domain-name-servers;'. + items: + description: |- + KeyValuePair is useful when wanting to realize a map as a list of key/value + pairs. + properties: + key: + description: Key is the key part of the + key/value pair. + type: string + value: + description: Value is the optional value + part of the key/value pair. + type: string + required: + - key + type: object + type: array + x-kubernetes-list-map-keys: + - key + x-kubernetes-list-type: map + enabled: + description: Enabled reports the status of the + DHCP client services. + type: boolean + type: object + type: object + macAddr: + description: MACAddr describes the observed MAC address + for this interface. + type: string + type: object + name: + description: |- + Name describes the corresponding network interface with the same name + in the VM's desired network interface list. If unset, then there is no + corresponding entry for this interface. + + + Please note this name is not necessarily related to the name of the + device as it is surfaced inside of the guest. + type: string + type: object + type: array + ipStacks: + description: |- + IPStacks describes information about the guest's configured IP networking + stacks. + items: + description: |- + VirtualMachineNetworkIPStackStatus describes the observed state of a + VM's IP stack. + properties: + dhcp: + description: DHCP describes the VM's observed, client-side, + system-wide DHCP options. + properties: + ip4: + description: IP4 describes the observed state of the + IP4 DHCP client settings. + properties: + config: + description: |- + Config describes platform-dependent settings for the DHCP client. + + + The key part is a unique number while the value part is the platform + specific configuration command. For example on Linux and BSD systems + using the file dhclient.conf output would be reported at system scope: + key='1', value='timeout 60;' key='2', value='reboot 10;'. The output + reported per interface would be: + key='1', value='prepend domain-name-servers 192.0.2.1;' + key='2', value='require subnet-mask, domain-name-servers;'. + items: + description: |- + KeyValuePair is useful when wanting to realize a map as a list of key/value + pairs. + properties: + key: + description: Key is the key part of the key/value + pair. + type: string + value: + description: Value is the optional value part + of the key/value pair. + type: string + required: + - key + type: object + type: array + x-kubernetes-list-map-keys: + - key + x-kubernetes-list-type: map + enabled: + description: Enabled reports the status of the DHCP + client services. + type: boolean + type: object + ip6: + description: IP6 describes the observed state of the + IP6 DHCP client settings. + properties: + config: + description: |- + Config describes platform-dependent settings for the DHCP client. + + + The key part is a unique number while the value part is the platform + specific configuration command. For example on Linux and BSD systems + using the file dhclient.conf output would be reported at system scope: + key='1', value='timeout 60;' key='2', value='reboot 10;'. The output + reported per interface would be: + key='1', value='prepend domain-name-servers 192.0.2.1;' + key='2', value='require subnet-mask, domain-name-servers;'. + items: + description: |- + KeyValuePair is useful when wanting to realize a map as a list of key/value + pairs. + properties: + key: + description: Key is the key part of the key/value + pair. + type: string + value: + description: Value is the optional value part + of the key/value pair. + type: string + required: + - key + type: object + type: array + x-kubernetes-list-map-keys: + - key + x-kubernetes-list-type: map + enabled: + description: Enabled reports the status of the DHCP + client services. + type: boolean + type: object + type: object + dns: + description: DNS describes the VM's observed, client-side + DNS configuration. + properties: + dhcp: + description: |- + DHCP indicates whether or not dynamic host control protocol (DHCP) was + used to configure DNS configuration. + type: boolean + domainName: + description: |- + DomainName is the domain name portion of the DNS name. For example, + the "domain.local" part of "my-vm.domain.local". + type: string + hostName: + description: |- + HostName is the host name portion of the DNS name. For example, + the "my-vm" part of "my-vm.domain.local". + type: string + nameservers: + description: |- + Nameservers is a list of the IP addresses for the DNS servers to use. + + + IP4 addresses are specified using dotted decimal notation. For example, + "192.0.2.1". + + + IP6 addresses are 128-bit addresses represented as eight fields of up to + four hexadecimal digits. A colon separates each field (:). For example, + 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of the + symbol '::' to represent multiple 16-bit groups of contiguous 0's only + once in an address as described in RFC 2373. + items: + type: string + type: array + searchDomains: + description: |- + SearchDomains is a list of domains in which to search for hosts, in the + order of preference. + items: + type: string + type: array + type: object + ipRoutes: + description: IPRoutes contain the VM's routing tables for + all address families. + items: + description: |- + VirtualMachineNetworkIPRouteStatus describes the observed state of a + guest network's IP routes. + properties: + gateway: + description: Gateway describes where to send the packets + to next. + properties: + address: + description: Address is the IP4 or IP6 address + of the gateway. + type: string + device: + description: |- + Device is the name of the device in the guest for which this gateway + applies. + type: string + type: object + networkAddress: + description: |- + NetworkAddress is the IP4 or IP6 address of the destination network. + + + Addresses include the network's prefix length, ex. 192.168.0.0/24 or + 2001:DB8:101::230:6eff:fe04:d9ff::/64. + + + IP6 addresses are 128-bit addresses represented as eight fields of up to + four hexadecimal digits. A colon separates each field (:). For example, + 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of symbol + '::' to represent multiple 16-bit groups of contiguous 0's only once in + an address as described in RFC 2373. + type: string + required: + - gateway + - networkAddress + type: object + type: array + kernelConfig: + description: |- + KernelConfig describes the observed state of the VM's kernel IP + configuration settings. + + + The key part contains a unique number while the value part contains the + 'key=value' as provided by the underlying provider. For example, on + Linux and/or BSD, the systcl -a output would be reported as: + key='5', value='net.ipv4.tcp_keepalive_time = 7200'. + items: + description: |- + KeyValuePair is useful when wanting to realize a map as a list of key/value + pairs. + properties: + key: + description: Key is the key part of the key/value + pair. + type: string + value: + description: Value is the optional value part of the + key/value pair. + type: string + required: + - key + type: object + type: array + x-kubernetes-list-map-keys: + - key + x-kubernetes-list-type: map + type: object + type: array + primaryIP4: + description: |- + PrimaryIP4 describes the VM's primary IP4 address. + + + If the bootstrap provider is CloudInit then this value is set to the + value of the VM's "guestinfo.local-ipv4" property. Please see + https://bit.ly/3NJB534 for more information on how this value is + calculated. + + + If the bootstrap provider is anything else then this field is set to the + value of the infrastructure VM's "guest.ipAddress" field. Please see + https://bit.ly/3Au0jM4 for more information. + type: string + primaryIP6: + description: |- + PrimaryIP6 describes the VM's primary IP6 address. + + + If the bootstrap provider is CloudInit then this value is set to the + value of the VM's "guestinfo.local-ipv6" property. Please see + https://bit.ly/3NJB534 for more information on how this value is + calculated. + + + If the bootstrap provider is anything else then this field is set to the + value of the infrastructure VM's "guest.ipAddress" field. Please see + https://bit.ly/3Au0jM4 for more information. + type: string + type: object + powerState: + description: PowerState describes the observed power state of the + VirtualMachine. + enum: + - PoweredOff + - PoweredOn + - Suspended + type: string + uniqueID: + description: |- + UniqueID describes a unique identifier that is provided by the underlying + infrastructure provider, such as vSphere. + type: string + volumes: + description: |- + Volumes describes a list of current status information for each Volume + that is desired to be attached to the VM. + items: + description: |- + VirtualMachineVolumeStatus defines the observed state of a + VirtualMachineVolume instance. + properties: + attached: + description: |- + Attached represents whether a volume has been successfully attached to + the VirtualMachine or not. + type: boolean + diskUUID: + description: |- + DiskUUID represents the underlying virtual disk UUID and is present when + attachment succeeds. + type: string + error: + description: |- + Error represents the last error seen when attaching or detaching a + volume. Error will be empty if attachment succeeds. + type: string + name: + description: Name is the name of the attached volume. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + zone: + description: |- + Zone describes the availability zone where the VirtualMachine has been + scheduled. + + Please note this field may be empty when the cluster is not zone-aware. type: string type: object diff --git a/config/crd/bases/vmoperator.vmware.com_virtualmachineservices.yaml b/config/crd/bases/vmoperator.vmware.com_virtualmachineservices.yaml index be6503fbd..6b8eea301 100644 --- a/config/crd/bases/vmoperator.vmware.com_virtualmachineservices.yaml +++ b/config/crd/bases/vmoperator.vmware.com_virtualmachineservices.yaml @@ -353,6 +353,177 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .spec.type + name: Type + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha3 + schema: + openAPIV3Schema: + description: VirtualMachineService is the Schema for the virtualmachineservices + 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: VirtualMachineServiceSpec defines the desired state of VirtualMachineService. + properties: + clusterIp: + description: |- + clusterIP is the IP address of the service and is usually assigned + randomly by the master. If an address is specified manually and is not in + use by others, it will be allocated to the service; otherwise, creation + of the service will fail. This field can not be changed through updates. + Valid values are "None", empty string (""), or a valid IP address. "None" + can be specified for headless services when proxying is not required. + Only applies to types ClusterIP and LoadBalancer. + Ignored if type is ExternalName. + More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies + type: string + externalName: + description: |- + externalName is the external reference that kubedns or equivalent will + return as a CNAME record for this service. No proxying will be involved. + Must be a valid RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) + and requires Type to be ExternalName. + type: string + loadBalancerIP: + description: |- + Only applies to VirtualMachineService Type: LoadBalancer + LoadBalancer will get created with the IP specified in this field. + This feature depends on whether the underlying load balancer provider + supports specifying the loadBalancerIP when a load balancer is created. + This field will be ignored if the provider does not support the feature. + Deprecated: This field was under-specified and its meaning varies across implementations. + Using it is non-portable and it may not support dual-stack. + Users are encouraged to use implementation-specific annotations when available. + type: string + loadBalancerSourceRanges: + description: |- + LoadBalancerSourceRanges is an array of IP addresses in the format of + CIDRs, for example: 103.21.244.0/22 and 10.0.0.0/24. + If specified and supported by the load balancer provider, this will + restrict ingress traffic to the specified client IPs. This field will be + ignored if the provider does not support the feature. + items: + type: string + type: array + ports: + description: |- + Ports specifies a list of VirtualMachineServicePort to expose with this + VirtualMachineService. Each of these ports will be an accessible network + entry point to access this service by. + items: + description: |- + VirtualMachineServicePort describes the specification of a service port to + be exposed by a VirtualMachineService. This VirtualMachineServicePort + specification includes attributes that define the external and internal + representation of the service port. + properties: + name: + description: |- + Name describes the name to be used to identify this + VirtualMachineServicePort. + type: string + port: + description: Port describes the external port that will be exposed + by the service. + format: int32 + type: integer + protocol: + description: |- + Protocol describes the Layer 4 transport protocol for this port. + Supports "TCP", "UDP", and "SCTP". + type: string + targetPort: + description: |- + TargetPort describes the internal port open on a VirtualMachine that + should be mapped to the external Port. + format: int32 + type: integer + required: + - name + - port + - protocol + - targetPort + type: object + type: array + selector: + additionalProperties: + type: string + description: |- + Selector specifies a map of key-value pairs, also known as a Label + Selector, that is used to match this VirtualMachineService with the set + of VirtualMachines that should back this VirtualMachineService. + type: object + type: + description: |- + Type specifies a desired VirtualMachineServiceType for this + VirtualMachineService. Supported types are ClusterIP, LoadBalancer, + ExternalName. + type: string + required: + - type + type: object + status: + description: |- + VirtualMachineServiceStatus defines the observed state of + VirtualMachineService. + properties: + loadBalancer: + description: |- + LoadBalancer contains the current status of the load balancer, + if one is present. + properties: + ingress: + description: |- + Ingress is a list containing ingress addresses for the load balancer. + Traffic intended for the service should be sent to any of these ingress + points. + items: + description: |- + LoadBalancerIngress represents the status of a load balancer ingress point: + traffic intended for the service should be sent to an ingress point. + IP or Hostname may both be set in this structure. It is up to the consumer to + determine which field should be used when accessing this LoadBalancer. + properties: + hostname: + description: |- + Hostname is set for load balancer ingress points that are specified by a + DNS address. + type: string + ip: + description: |- + IP is set for load balancer ingress points that are specified by an IP + address. + type: string + type: object + type: array + type: object + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/vmoperator.vmware.com_virtualmachinesetresourcepolicies.yaml b/config/crd/bases/vmoperator.vmware.com_virtualmachinesetresourcepolicies.yaml index d8ad38d16..102a49d81 100644 --- a/config/crd/bases/vmoperator.vmware.com_virtualmachinesetresourcepolicies.yaml +++ b/config/crd/bases/vmoperator.vmware.com_virtualmachinesetresourcepolicies.yaml @@ -235,6 +235,114 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - name: v1alpha3 + schema: + openAPIV3Schema: + description: VirtualMachineSetResourcePolicy is the Schema for the virtualmachinesetresourcepolicies + 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: |- + VirtualMachineSetResourcePolicySpec defines the desired state of + VirtualMachineSetResourcePolicy. + properties: + clusterModuleGroups: + items: + type: string + type: array + folder: + type: string + resourcePool: + description: |- + ResourcePoolSpec defines a Logical Grouping of workloads that share resource + policies. + properties: + limits: + description: Limits describes the limit to resources available + to the ResourcePool. + properties: + cpu: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + memory: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + name: + description: Name describes the name of the ResourcePool grouping. + type: string + reservations: + description: |- + Reservations describes the guaranteed resources reserved for the + ResourcePool. + properties: + cpu: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + memory: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + type: object + status: + description: |- + VirtualMachineSetResourcePolicyStatus defines the observed state of + VirtualMachineSetResourcePolicy. + properties: + clustermodules: + items: + description: |- + VSphereClusterModuleStatus describes the observed state of a vSphere + cluster module. + properties: + clusterMoID: + type: string + groupName: + type: string + moduleUUID: + type: string + required: + - clusterMoID + - groupName + - moduleUUID + type: object + type: array + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/vmoperator.vmware.com_virtualmachinewebconsolerequests.yaml b/config/crd/bases/vmoperator.vmware.com_virtualmachinewebconsolerequests.yaml index 24d853b10..98c7602ed 100644 --- a/config/crd/bases/vmoperator.vmware.com_virtualmachinewebconsolerequests.yaml +++ b/config/crd/bases/vmoperator.vmware.com_virtualmachinewebconsolerequests.yaml @@ -72,6 +72,100 @@ spec: the VM's web console. + The value could be a DNS entry, IPv4, or IPv6 address, followed by an + optional port. For example, valid values include: + + + DNS + * host.com + * host.com:6443 + + + IPv4 + * 1.2.3.4 + * 1.2.3.4:6443 + + + IPv6 + * 1234:1234:1234:1234:1234:1234:1234:1234 + * [1234:1234:1234:1234:1234:1234:1234:1234]:6443 + * 1234:1234:1234:0000:0000:0000:1234:1234 + * 1234:1234:1234::::1234:1234 + * [1234:1234:1234::::1234:1234]:6443 + + + In other words, the field may be set to any value that is parsable + by Go's https://pkg.go.dev/net#ResolveIPAddr and + https://pkg.go.dev/net#ParseIP functions. + type: string + response: + description: Response will be the authenticated ticket corresponding + to this web console request. + type: string + type: object + type: object + served: true + storage: false + subresources: + status: {} + - name: v1alpha3 + schema: + openAPIV3Schema: + description: |- + VirtualMachineWebConsoleRequest allows the creation of a one-time, web + console connection to a VM. + 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: |- + VirtualMachineWebConsoleRequestSpec describes the desired state for a web + console request to a VM. + properties: + name: + description: |- + Name is the name of a VM in the same Namespace as this web console + request. + type: string + publicKey: + description: PublicKey is used to encrypt the status.response. This + is expected to be a RSA OAEP public key in X.509 PEM format. + type: string + required: + - name + - publicKey + type: object + status: + description: |- + VirtualMachineWebConsoleRequestStatus describes the observed state of the + request. + properties: + expiryTime: + description: ExpiryTime is the time at which access via this request + will expire. + format: date-time + type: string + proxyAddr: + description: |- + ProxyAddr describes the host address and optional port used to access + the VM's web console. + + The value could be a DNS entry, IPv4, or IPv6 address, followed by an optional port. For example, valid values include: diff --git a/config/webhook/manifests.yaml b/config/webhook/manifests.yaml index 0c1b25450..dbabbb053 100644 --- a/config/webhook/manifests.yaml +++ b/config/webhook/manifests.yaml @@ -11,14 +11,14 @@ webhooks: service: name: webhook-service namespace: system - path: /default-mutate-vmoperator-vmware-com-v1alpha2-virtualmachine + path: /default-mutate-vmoperator-vmware-com-v1alpha3-virtualmachine failurePolicy: Fail - name: default.mutating.virtualmachine.v1alpha2.vmoperator.vmware.com + name: default.mutating.virtualmachine.v1alpha3.vmoperator.vmware.com rules: - apiGroups: - vmoperator.vmware.com apiVersions: - - v1alpha2 + - v1alpha3 operations: - CREATE - UPDATE @@ -59,14 +59,14 @@ webhooks: service: name: webhook-service namespace: system - path: /default-validate-vmoperator-vmware-com-v1alpha2-virtualmachine + path: /default-validate-vmoperator-vmware-com-v1alpha3-virtualmachine failurePolicy: Fail - name: default.validating.virtualmachine.v1alpha2.vmoperator.vmware.com + name: default.validating.virtualmachine.v1alpha3.vmoperator.vmware.com rules: - apiGroups: - vmoperator.vmware.com apiVersions: - - v1alpha2 + - v1alpha3 operations: - CREATE - UPDATE @@ -80,14 +80,14 @@ webhooks: service: name: webhook-service namespace: system - path: /default-validate-vmoperator-vmware-com-v1alpha2-virtualmachineclass + path: /default-validate-vmoperator-vmware-com-v1alpha3-virtualmachineclass failurePolicy: Fail - name: default.validating.virtualmachineclass.v1alpha2.vmoperator.vmware.com + name: default.validating.virtualmachineclass.v1alpha3.vmoperator.vmware.com rules: - apiGroups: - vmoperator.vmware.com apiVersions: - - v1alpha2 + - v1alpha3 operations: - CREATE - UPDATE @@ -101,14 +101,14 @@ webhooks: service: name: webhook-service namespace: system - path: /default-validate-vmoperator-vmware-com-v1alpha2-virtualmachinepublishrequest + path: /default-validate-vmoperator-vmware-com-v1alpha3-virtualmachinepublishrequest failurePolicy: Fail - name: default.validating.virtualmachinepublishrequest.v1alpha2.vmoperator.vmware.com + name: default.validating.virtualmachinepublishrequest.v1alpha3.vmoperator.vmware.com rules: - apiGroups: - vmoperator.vmware.com apiVersions: - - v1alpha2 + - v1alpha3 operations: - CREATE - UPDATE @@ -122,14 +122,14 @@ webhooks: service: name: webhook-service namespace: system - path: /default-validate-vmoperator-vmware-com-v1alpha2-virtualmachineservice + path: /default-validate-vmoperator-vmware-com-v1alpha3-virtualmachineservice failurePolicy: Fail - name: default.validating.virtualmachineservice.v1alpha2.vmoperator.vmware.com + name: default.validating.virtualmachineservice.v1alpha3.vmoperator.vmware.com rules: - apiGroups: - vmoperator.vmware.com apiVersions: - - v1alpha2 + - v1alpha3 operations: - CREATE - UPDATE @@ -143,14 +143,14 @@ webhooks: service: name: webhook-service namespace: system - path: /default-validate-vmoperator-vmware-com-v1alpha2-virtualmachinesetresourcepolicy + path: /default-validate-vmoperator-vmware-com-v1alpha3-virtualmachinesetresourcepolicy failurePolicy: Fail - name: default.validating.virtualmachinesetresourcepolicy.v1alpha2.vmoperator.vmware.com + name: default.validating.virtualmachinesetresourcepolicy.v1alpha3.vmoperator.vmware.com rules: - apiGroups: - vmoperator.vmware.com apiVersions: - - v1alpha2 + - v1alpha3 operations: - CREATE - UPDATE @@ -185,14 +185,14 @@ webhooks: service: name: webhook-service namespace: system - path: /default-validate-vmoperator-vmware-com-v1alpha2-virtualmachinewebconsolerequest + path: /default-validate-vmoperator-vmware-com-v1alpha3-virtualmachinewebconsolerequest failurePolicy: Fail - name: default.validating.virtualmachinewebconsolerequest.v1alpha2.vmoperator.vmware.com + name: default.validating.virtualmachinewebconsolerequest.v1alpha3.vmoperator.vmware.com rules: - apiGroups: - vmoperator.vmware.com apiVersions: - - v1alpha2 + - v1alpha3 operations: - CREATE - UPDATE diff --git a/controllers/contentlibrary/v1alpha2/clustercontentlibraryitem/clustercontentlibraryitem_controller.go b/controllers/contentlibrary/clustercontentlibraryitem/clustercontentlibraryitem_controller.go similarity index 95% rename from controllers/contentlibrary/v1alpha2/clustercontentlibraryitem/clustercontentlibraryitem_controller.go rename to controllers/contentlibrary/clustercontentlibraryitem/clustercontentlibraryitem_controller.go index 102817334..9eff7849b 100644 --- a/controllers/contentlibrary/v1alpha2/clustercontentlibraryitem/clustercontentlibraryitem_controller.go +++ b/controllers/contentlibrary/clustercontentlibraryitem/clustercontentlibraryitem_controller.go @@ -20,9 +20,9 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/utils" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils" "github.com/vmware-tanzu/vm-operator/pkg/conditions" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -47,7 +47,7 @@ func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) er mgr.GetClient(), ctrl.Log.WithName("controllers").WithName(cclItemTypeName), record.New(mgr.GetEventRecorderFor(controllerNameLong)), - ctx.VMProviderA2, + ctx.VMProvider, ) return ctrl.NewControllerManagedBy(mgr). @@ -63,7 +63,7 @@ func NewReconciler( client client.Client, logger logr.Logger, recorder record.Recorder, - vmProvider vmprovider.VirtualMachineProviderInterfaceA2) *Reconciler { + vmProvider vmprovider.VirtualMachineProviderInterface) *Reconciler { return &Reconciler{ Context: ctx, @@ -82,7 +82,7 @@ type Reconciler struct { Context goctx.Context Logger logr.Logger Recorder record.Recorder - VMProvider vmprovider.VirtualMachineProviderInterfaceA2 + VMProvider vmprovider.VirtualMachineProviderInterface Metrics *metrics.ContentLibraryItemMetrics } @@ -109,7 +109,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Resu } logger = logger.WithValues("cvmiName", cvmiName) - cclItemCtx := &context.ClusterContentLibraryItemContextA2{ + cclItemCtx := &context.ClusterContentLibraryItemContext{ Context: ctx, Logger: logger, CCLItem: cclItem, @@ -127,7 +127,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Resu } // ReconcileDelete reconciles a deletion for a ClusterContentLibraryItem resource. -func (r *Reconciler) ReconcileDelete(ctx *context.ClusterContentLibraryItemContextA2) error { +func (r *Reconciler) ReconcileDelete(ctx *context.ClusterContentLibraryItemContext) error { if controllerutil.ContainsFinalizer(ctx.CCLItem, utils.ClusterContentLibraryItemVmopFinalizer) { r.Metrics.DeleteMetrics(ctx.Logger, ctx.ImageObjName, "") controllerutil.RemoveFinalizer(ctx.CCLItem, utils.ClusterContentLibraryItemVmopFinalizer) @@ -139,7 +139,7 @@ func (r *Reconciler) ReconcileDelete(ctx *context.ClusterContentLibraryItemConte // ReconcileNormal reconciles a ClusterContentLibraryItem resource by creating or // updating the corresponding ClusterVirtualMachineImage resource. -func (r *Reconciler) ReconcileNormal(ctx *context.ClusterContentLibraryItemContextA2) error { +func (r *Reconciler) ReconcileNormal(ctx *context.ClusterContentLibraryItemContext) error { if !controllerutil.ContainsFinalizer(ctx.CCLItem, utils.ClusterContentLibraryItemVmopFinalizer) { // The finalizer must be present before proceeding in order to ensure ReconcileDelete() will be called. // Return immediately after here to update the object and then we'll proceed on the next reconciliation. @@ -238,7 +238,7 @@ func (r *Reconciler) ReconcileNormal(ctx *context.ClusterContentLibraryItemConte // setUpCVMIFromCCLItem sets up the ClusterVirtualMachineImage fields that // are retrievable from the given ClusterContentLibraryItem resource. -func (r *Reconciler) setUpCVMIFromCCLItem(ctx *context.ClusterContentLibraryItemContextA2) error { +func (r *Reconciler) setUpCVMIFromCCLItem(ctx *context.ClusterContentLibraryItemContext) error { cclItem := ctx.CCLItem cvmi := ctx.CVMI @@ -276,7 +276,7 @@ func (r *Reconciler) setUpCVMIFromCCLItem(ctx *context.ClusterContentLibraryItem } } - cvmi.Spec.ProviderRef = common.LocalObjectRef{ + cvmi.Spec.ProviderRef = &common.LocalObjectRef{ APIVersion: cclItem.APIVersion, Kind: cclItem.Kind, Name: cclItem.Name, @@ -290,7 +290,7 @@ func (r *Reconciler) setUpCVMIFromCCLItem(ctx *context.ClusterContentLibraryItem // syncImageContent syncs the ClusterVirtualMachineImage content from the provider. // It skips syncing if the image content is already up-to-date. -func (r *Reconciler) syncImageContent(ctx *context.ClusterContentLibraryItemContextA2) error { +func (r *Reconciler) syncImageContent(ctx *context.ClusterContentLibraryItemContext) error { cclItem := ctx.CCLItem cvmi := ctx.CVMI latestVersion := cclItem.Status.ContentVersion diff --git a/controllers/contentlibrary/v1alpha2/clustercontentlibraryitem/clustercontentlibraryitem_controller_intg_test.go b/controllers/contentlibrary/clustercontentlibraryitem/clustercontentlibraryitem_controller_intg_test.go similarity index 98% rename from controllers/contentlibrary/v1alpha2/clustercontentlibraryitem/clustercontentlibraryitem_controller_intg_test.go rename to controllers/contentlibrary/clustercontentlibraryitem/clustercontentlibraryitem_controller_intg_test.go index 97b84bef4..73def34a8 100644 --- a/controllers/contentlibrary/v1alpha2/clustercontentlibraryitem/clustercontentlibraryitem_controller_intg_test.go +++ b/controllers/contentlibrary/clustercontentlibraryitem/clustercontentlibraryitem_controller_intg_test.go @@ -19,8 +19,8 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/utils" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -32,7 +32,7 @@ func intgTests() { Label( testlabels.Controller, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), intgTestsReconcile, ) diff --git a/controllers/contentlibrary/v1alpha2/clustercontentlibraryitem/clustercontentlibraryitem_controller_suite_test.go b/controllers/contentlibrary/clustercontentlibraryitem/clustercontentlibraryitem_controller_suite_test.go similarity index 88% rename from controllers/contentlibrary/v1alpha2/clustercontentlibraryitem/clustercontentlibraryitem_controller_suite_test.go rename to controllers/contentlibrary/clustercontentlibraryitem/clustercontentlibraryitem_controller_suite_test.go index 41c8bd891..90d4b89b5 100644 --- a/controllers/contentlibrary/v1alpha2/clustercontentlibraryitem/clustercontentlibraryitem_controller_suite_test.go +++ b/controllers/contentlibrary/clustercontentlibraryitem/clustercontentlibraryitem_controller_suite_test.go @@ -10,20 +10,20 @@ import ( ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/clustercontentlibraryitem" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/clustercontentlibraryitem" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" ctrlContext "github.com/vmware-tanzu/vm-operator/pkg/context" providerfake "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/fake" "github.com/vmware-tanzu/vm-operator/test/builder" ) -var intgFakeVMProvider = providerfake.NewVMProviderA2() +var intgFakeVMProvider = providerfake.NewVMProvider() var suite = builder.NewTestSuiteForControllerWithContext( pkgconfig.NewContextWithDefaultConfig(), clustercontentlibraryitem.AddToManager, func(ctx *ctrlContext.ControllerManagerContext, _ ctrlmgr.Manager) error { - ctx.VMProviderA2 = intgFakeVMProvider + ctx.VMProvider = intgFakeVMProvider return nil }) diff --git a/controllers/contentlibrary/v1alpha2/clustercontentlibraryitem/clustercontentlibraryitem_controller_unit_test.go b/controllers/contentlibrary/clustercontentlibraryitem/clustercontentlibraryitem_controller_unit_test.go similarity index 95% rename from controllers/contentlibrary/v1alpha2/clustercontentlibraryitem/clustercontentlibraryitem_controller_unit_test.go rename to controllers/contentlibrary/clustercontentlibraryitem/clustercontentlibraryitem_controller_unit_test.go index 307292fbf..6a774db1d 100644 --- a/controllers/contentlibrary/v1alpha2/clustercontentlibraryitem/clustercontentlibraryitem_controller_unit_test.go +++ b/controllers/contentlibrary/clustercontentlibraryitem/clustercontentlibraryitem_controller_unit_test.go @@ -17,10 +17,10 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/clustercontentlibraryitem" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/utils" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/clustercontentlibraryitem" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -33,7 +33,7 @@ func unitTests() { "Reconcile", Label( testlabels.Controller, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), unitTestsReconcile, ) @@ -46,10 +46,10 @@ func unitTestsReconcile() { ctx *builder.UnitTestContextForController reconciler *clustercontentlibraryitem.Reconciler - fakeVMProvider *providerfake.VMProviderA2 + fakeVMProvider *providerfake.VMProvider cclItem *imgregv1a1.ClusterContentLibraryItem - cclItemCtx *context.ClusterContentLibraryItemContextA2 + cclItemCtx *context.ClusterContentLibraryItemContext ) BeforeEach(func() { @@ -60,10 +60,10 @@ func unitTestsReconcile() { ctx.Client, ctx.Logger, ctx.Recorder, - ctx.VMProviderA2, + ctx.VMProvider, ) - fakeVMProvider = ctx.VMProviderA2.(*providerfake.VMProviderA2) + fakeVMProvider = ctx.VMProvider.(*providerfake.VMProvider) fakeVMProvider.SyncVirtualMachineImageFn = func(_ goctx.Context, _, cvmiObj client.Object) error { cvmi := cvmiObj.(*vmopv1.ClusterVirtualMachineImage) // Use Firmware field to verify the provider function is called. @@ -82,7 +82,7 @@ func unitTestsReconcile() { imageName, err := utils.GetImageFieldNameFromItem(cclItem.Name) Expect(err).ToNot(HaveOccurred()) - cclItemCtx = &context.ClusterContentLibraryItemContextA2{ + cclItemCtx = &context.ClusterContentLibraryItemContext{ Context: ctx, Logger: ctx.Logger, CCLItem: cclItem, @@ -232,7 +232,7 @@ func unitTestsReconcile() { Name: cclItemCtx.ImageObjName, }, Spec: vmopv1.VirtualMachineImageSpec{ - ProviderRef: common.LocalObjectRef{ + ProviderRef: &common.LocalObjectRef{ Name: "bogus", }, }, diff --git a/controllers/contentlibrary/v1alpha2/contentlibraryitem/contentlibraryitem_controller.go b/controllers/contentlibrary/contentlibraryitem/contentlibraryitem_controller.go similarity index 95% rename from controllers/contentlibrary/v1alpha2/contentlibraryitem/contentlibraryitem_controller.go rename to controllers/contentlibrary/contentlibraryitem/contentlibraryitem_controller.go index d136239a4..89fba62ec 100644 --- a/controllers/contentlibrary/v1alpha2/contentlibraryitem/contentlibraryitem_controller.go +++ b/controllers/contentlibrary/contentlibraryitem/contentlibraryitem_controller.go @@ -20,9 +20,9 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/utils" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils" "github.com/vmware-tanzu/vm-operator/pkg/conditions" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -47,7 +47,7 @@ func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) er mgr.GetClient(), ctrl.Log.WithName("controllers").WithName(clItemTypeName), record.New(mgr.GetEventRecorderFor(controllerNameLong)), - ctx.VMProviderA2, + ctx.VMProvider, ) return ctrl.NewControllerManagedBy(mgr). @@ -63,7 +63,7 @@ func NewReconciler( client client.Client, logger logr.Logger, recorder record.Recorder, - vmProvider vmprovider.VirtualMachineProviderInterfaceA2) *Reconciler { + vmProvider vmprovider.VirtualMachineProviderInterface) *Reconciler { return &Reconciler{ Context: ctx, @@ -82,7 +82,7 @@ type Reconciler struct { Context goctx.Context Logger logr.Logger Recorder record.Recorder - VMProvider vmprovider.VirtualMachineProviderInterfaceA2 + VMProvider vmprovider.VirtualMachineProviderInterface Metrics *metrics.ContentLibraryItemMetrics } @@ -109,7 +109,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Resu } logger = logger.WithValues("vmiName", vmiName) - clItemCtx := &context.ContentLibraryItemContextA2{ + clItemCtx := &context.ContentLibraryItemContext{ Context: ctx, Logger: logger, CLItem: clItem, @@ -127,7 +127,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Resu } // ReconcileDelete reconciles a deletion for a ContentLibraryItem resource. -func (r *Reconciler) ReconcileDelete(ctx *context.ContentLibraryItemContextA2) error { +func (r *Reconciler) ReconcileDelete(ctx *context.ContentLibraryItemContext) error { if controllerutil.ContainsFinalizer(ctx.CLItem, utils.ContentLibraryItemVmopFinalizer) { r.Metrics.DeleteMetrics(ctx.Logger, ctx.ImageObjName, ctx.CLItem.Namespace) controllerutil.RemoveFinalizer(ctx.CLItem, utils.ContentLibraryItemVmopFinalizer) @@ -139,7 +139,7 @@ func (r *Reconciler) ReconcileDelete(ctx *context.ContentLibraryItemContextA2) e // ReconcileNormal reconciles a ContentLibraryItem resource by creating or // updating the corresponding VirtualMachineImage resource. -func (r *Reconciler) ReconcileNormal(ctx *context.ContentLibraryItemContextA2) error { +func (r *Reconciler) ReconcileNormal(ctx *context.ContentLibraryItemContext) error { if !controllerutil.ContainsFinalizer(ctx.CLItem, utils.ContentLibraryItemVmopFinalizer) { // The finalizer must be present before proceeding in order to ensure ReconcileDelete() will be called. // Return immediately after here to update the object and then we'll proceed on the next reconciliation. @@ -238,14 +238,14 @@ func (r *Reconciler) ReconcileNormal(ctx *context.ContentLibraryItemContextA2) e // setUpVMIFromCLItem sets up the VirtualMachineImage fields that // are retrievable from the given ContentLibraryItem resource. -func (r *Reconciler) setUpVMIFromCLItem(ctx *context.ContentLibraryItemContextA2) error { +func (r *Reconciler) setUpVMIFromCLItem(ctx *context.ContentLibraryItemContext) error { clItem := ctx.CLItem vmi := ctx.VMI if err := controllerutil.SetControllerReference(clItem, vmi, r.Scheme()); err != nil { return err } - vmi.Spec.ProviderRef = common.LocalObjectRef{ + vmi.Spec.ProviderRef = &common.LocalObjectRef{ APIVersion: clItem.APIVersion, Kind: clItem.Kind, Name: clItem.Name, @@ -258,7 +258,7 @@ func (r *Reconciler) setUpVMIFromCLItem(ctx *context.ContentLibraryItemContextA2 // syncImageContent syncs the VirtualMachineImage content from the provider. // It skips syncing if the image content is already up-to-date. -func (r *Reconciler) syncImageContent(ctx *context.ContentLibraryItemContextA2) error { +func (r *Reconciler) syncImageContent(ctx *context.ContentLibraryItemContext) error { clItem := ctx.CLItem vmi := ctx.VMI latestVersion := clItem.Status.ContentVersion diff --git a/controllers/contentlibrary/v1alpha2/contentlibraryitem/contentlibraryitem_controller_intg_test.go b/controllers/contentlibrary/contentlibraryitem/contentlibraryitem_controller_intg_test.go similarity index 98% rename from controllers/contentlibrary/v1alpha2/contentlibraryitem/contentlibraryitem_controller_intg_test.go rename to controllers/contentlibrary/contentlibraryitem/contentlibraryitem_controller_intg_test.go index 4eacb9c3c..b58b31ac6 100644 --- a/controllers/contentlibrary/v1alpha2/contentlibraryitem/contentlibraryitem_controller_intg_test.go +++ b/controllers/contentlibrary/contentlibraryitem/contentlibraryitem_controller_intg_test.go @@ -16,8 +16,8 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/utils" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -29,7 +29,7 @@ func intgTests() { Label( testlabels.Controller, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), intgTestsReconcile, ) diff --git a/controllers/contentlibrary/v1alpha2/contentlibraryitem/contentlibraryitem_controller_suite_test.go b/controllers/contentlibrary/contentlibraryitem/contentlibraryitem_controller_suite_test.go similarity index 88% rename from controllers/contentlibrary/v1alpha2/contentlibraryitem/contentlibraryitem_controller_suite_test.go rename to controllers/contentlibrary/contentlibraryitem/contentlibraryitem_controller_suite_test.go index 4c339b1d6..623cbce09 100644 --- a/controllers/contentlibrary/v1alpha2/contentlibraryitem/contentlibraryitem_controller_suite_test.go +++ b/controllers/contentlibrary/contentlibraryitem/contentlibraryitem_controller_suite_test.go @@ -9,20 +9,20 @@ import ( . "github.com/onsi/ginkgo/v2" ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/contentlibraryitem" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/contentlibraryitem" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" ctrlContext "github.com/vmware-tanzu/vm-operator/pkg/context" providerfake "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/fake" "github.com/vmware-tanzu/vm-operator/test/builder" ) -var intgFakeVMProvider = providerfake.NewVMProviderA2() +var intgFakeVMProvider = providerfake.NewVMProvider() var suite = builder.NewTestSuiteForControllerWithContext( pkgconfig.NewContextWithDefaultConfig(), contentlibraryitem.AddToManager, func(ctx *ctrlContext.ControllerManagerContext, _ ctrlmgr.Manager) error { - ctx.VMProviderA2 = intgFakeVMProvider + ctx.VMProvider = intgFakeVMProvider return nil }) diff --git a/controllers/contentlibrary/v1alpha2/contentlibraryitem/contentlibraryitem_controller_unit_test.go b/controllers/contentlibrary/contentlibraryitem/contentlibraryitem_controller_unit_test.go similarity index 94% rename from controllers/contentlibrary/v1alpha2/contentlibraryitem/contentlibraryitem_controller_unit_test.go rename to controllers/contentlibrary/contentlibraryitem/contentlibraryitem_controller_unit_test.go index 249601e89..2c9a4e6cf 100644 --- a/controllers/contentlibrary/v1alpha2/contentlibraryitem/contentlibraryitem_controller_unit_test.go +++ b/controllers/contentlibrary/contentlibraryitem/contentlibraryitem_controller_unit_test.go @@ -17,10 +17,10 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/contentlibraryitem" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/utils" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/contentlibraryitem" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -33,7 +33,7 @@ func unitTests() { "Reconcile", Label( testlabels.Controller, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), unitTestsReconcile, ) @@ -46,10 +46,10 @@ func unitTestsReconcile() { ctx *builder.UnitTestContextForController reconciler *contentlibraryitem.Reconciler - fakeVMProvider *providerfake.VMProviderA2 + fakeVMProvider *providerfake.VMProvider clItem *imgregv1a1.ContentLibraryItem - clItemCtx *context.ContentLibraryItemContextA2 + clItemCtx *context.ContentLibraryItemContext ) BeforeEach(func() { @@ -60,10 +60,10 @@ func unitTestsReconcile() { ctx.Client, ctx.Logger, ctx.Recorder, - ctx.VMProviderA2, + ctx.VMProvider, ) - fakeVMProvider = ctx.VMProviderA2.(*providerfake.VMProviderA2) + fakeVMProvider = ctx.VMProvider.(*providerfake.VMProvider) fakeVMProvider.SyncVirtualMachineImageFn = func(_ goctx.Context, _, vmiObj client.Object) error { vmi := vmiObj.(*vmopv1.VirtualMachineImage) @@ -83,7 +83,7 @@ func unitTestsReconcile() { imageName, err := utils.GetImageFieldNameFromItem(clItem.Name) Expect(err).ToNot(HaveOccurred()) - clItemCtx = &context.ContentLibraryItemContextA2{ + clItemCtx = &context.ContentLibraryItemContext{ Context: ctx, Logger: ctx.Logger, CLItem: clItem, @@ -209,7 +209,7 @@ func unitTestsReconcile() { Namespace: clItem.Namespace, }, Spec: vmopv1.VirtualMachineImageSpec{ - ProviderRef: common.LocalObjectRef{ + ProviderRef: &common.LocalObjectRef{ Name: "bogus", }, }, @@ -275,7 +275,7 @@ func unitTestsReconcile() { func getVMI( ctx *builder.UnitTestContextForController, - clItemCtx *context.ContentLibraryItemContextA2) *vmopv1.VirtualMachineImage { + clItemCtx *context.ContentLibraryItemContext) *vmopv1.VirtualMachineImage { vmi := &vmopv1.VirtualMachineImage{} Expect(ctx.Client.Get(ctx, client.ObjectKey{Name: clItemCtx.ImageObjName, Namespace: clItemCtx.CLItem.Namespace}, vmi)).To(Succeed()) diff --git a/controllers/contentlibrary/controllers.go b/controllers/contentlibrary/controllers.go index e3ecd8cae..cb564e17a 100644 --- a/controllers/contentlibrary/controllers.go +++ b/controllers/contentlibrary/controllers.go @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2023-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package contentlibrary @@ -6,11 +6,15 @@ package contentlibrary import ( "sigs.k8s.io/controller-runtime/pkg/manager" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/clustercontentlibraryitem" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/contentlibraryitem" "github.com/vmware-tanzu/vm-operator/pkg/context" ) // AddToManager adds the controller to the provided manager. func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) error { - return v1alpha2.AddToManager(ctx, mgr) + if err := clustercontentlibraryitem.AddToManager(ctx, mgr); err != nil { + return err + } + return contentlibraryitem.AddToManager(ctx, mgr) } diff --git a/controllers/contentlibrary/v1alpha2/utils/constants.go b/controllers/contentlibrary/utils/constants.go similarity index 100% rename from controllers/contentlibrary/v1alpha2/utils/constants.go rename to controllers/contentlibrary/utils/constants.go diff --git a/controllers/contentlibrary/v1alpha2/utils/test_utils.go b/controllers/contentlibrary/utils/test_utils.go similarity index 100% rename from controllers/contentlibrary/v1alpha2/utils/test_utils.go rename to controllers/contentlibrary/utils/test_utils.go diff --git a/controllers/contentlibrary/v1alpha2/utils/utils.go b/controllers/contentlibrary/utils/utils.go similarity index 100% rename from controllers/contentlibrary/v1alpha2/utils/utils.go rename to controllers/contentlibrary/utils/utils.go diff --git a/controllers/contentlibrary/v1alpha2/utils/utils_test.go b/controllers/contentlibrary/utils/utils_test.go similarity index 96% rename from controllers/contentlibrary/v1alpha2/utils/utils_test.go rename to controllers/contentlibrary/utils/utils_test.go index 703e05cb0..d9876fb23 100644 --- a/controllers/contentlibrary/v1alpha2/utils/utils_test.go +++ b/controllers/contentlibrary/utils/utils_test.go @@ -16,8 +16,8 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/utils" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils" ) func Test_AddContentLibRefToAnnotation(t *testing.T) { diff --git a/controllers/contentlibrary/v1alpha2/controllers.go b/controllers/contentlibrary/v1alpha2/controllers.go deleted file mode 100644 index 6c7b9cbd9..000000000 --- a/controllers/contentlibrary/v1alpha2/controllers.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package v1alpha2 - -import ( - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/clustercontentlibraryitem" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/contentlibraryitem" - "github.com/vmware-tanzu/vm-operator/pkg/context" -) - -// AddToManager adds the controllers to the provided manager. -func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) error { - if err := clustercontentlibraryitem.AddToManager(ctx, mgr); err != nil { - return errors.Wrap(err, "failed to initialize ClusterContentLibraryItem controller") - } - if err := contentlibraryitem.AddToManager(ctx, mgr); err != nil { - return errors.Wrap(err, "failed to initialize ContentLibraryItem controller") - } - - return nil -} diff --git a/controllers/infra/configmap/infra_configmap_controller.go b/controllers/infra/configmap/infra_configmap_controller.go index 505be531b..e8e3e7239 100644 --- a/controllers/infra/configmap/infra_configmap_controller.go +++ b/controllers/infra/configmap/infra_configmap_controller.go @@ -41,7 +41,7 @@ func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) er ctrl.Log.WithName("controllers").WithName(controllerName), record.New(mgr.GetEventRecorderFor(controllerNameLong)), ctx.Namespace, - ctx.VMProviderA2, + ctx.VMProvider, ) c, err := controller.New(controllerName, mgr, controller.Options{Reconciler: r}) diff --git a/controllers/infra/configmap/infra_configmap_controller_intg_test.go b/controllers/infra/configmap/infra_configmap_controller_intg_test.go index 0c7550d07..f61bf4ad3 100644 --- a/controllers/infra/configmap/infra_configmap_controller_intg_test.go +++ b/controllers/infra/configmap/infra_configmap_controller_intg_test.go @@ -24,7 +24,7 @@ func intgTests() { Label( testlabels.Controller, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), intgTestsReconcile, ) diff --git a/controllers/infra/configmap/infra_configmap_suite_test.go b/controllers/infra/configmap/infra_configmap_suite_test.go index 4ddf5a20e..1a8fed590 100644 --- a/controllers/infra/configmap/infra_configmap_suite_test.go +++ b/controllers/infra/configmap/infra_configmap_suite_test.go @@ -16,12 +16,12 @@ import ( "github.com/vmware-tanzu/vm-operator/test/builder" ) -var provider = providerfake.NewVMProviderA2() +var provider = providerfake.NewVMProvider() var suite = builder.NewTestSuiteForController( configmap.AddToManager, func(ctx *ctrlContext.ControllerManagerContext, _ ctrlmgr.Manager) error { - ctx.VMProviderA2 = provider + ctx.VMProvider = provider return nil }, ) diff --git a/controllers/infra/configmap/infra_configmap_test.go b/controllers/infra/configmap/infra_configmap_test.go index ddb7dac09..88a59f996 100644 --- a/controllers/infra/configmap/infra_configmap_test.go +++ b/controllers/infra/configmap/infra_configmap_test.go @@ -12,7 +12,7 @@ import ( ) func unitTests() { - Describe("WCP Config", Label(testlabels.V1Alpha2), unitTestsWcpConfig) + Describe("WCP Config", Label(testlabels.V1Alpha3), unitTestsWcpConfig) } func unitTestsWcpConfig() { diff --git a/controllers/infra/node/infra_node_controller.go b/controllers/infra/node/infra_node_controller.go index 0e488d4ff..fdcb050b7 100644 --- a/controllers/infra/node/infra_node_controller.go +++ b/controllers/infra/node/infra_node_controller.go @@ -39,7 +39,7 @@ func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) er mgr.GetClient(), ctrl.Log.WithName("controllers").WithName(controllerName), record.New(mgr.GetEventRecorderFor(controllerNameLong)), - ctx.VMProviderA2, + ctx.VMProvider, ) return ctrl.NewControllerManagedBy(mgr). diff --git a/controllers/infra/node/infra_node_controller_intg_test.go b/controllers/infra/node/infra_node_controller_intg_test.go index 4690210f4..3685f230a 100644 --- a/controllers/infra/node/infra_node_controller_intg_test.go +++ b/controllers/infra/node/infra_node_controller_intg_test.go @@ -24,7 +24,7 @@ func intgTests() { Label( testlabels.Controller, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), intgTestsReconcile, ) diff --git a/controllers/infra/node/infra_node_controller_suite_test.go b/controllers/infra/node/infra_node_controller_suite_test.go index b356ee6f3..eb9421d95 100644 --- a/controllers/infra/node/infra_node_controller_suite_test.go +++ b/controllers/infra/node/infra_node_controller_suite_test.go @@ -16,12 +16,12 @@ import ( "github.com/vmware-tanzu/vm-operator/test/builder" ) -var intgFakeVMProvider = providerfake.NewVMProviderA2() +var intgFakeVMProvider = providerfake.NewVMProvider() var suite = builder.NewTestSuiteForController( node.AddToManager, func(ctx *ctrlContext.ControllerManagerContext, _ ctrlmgr.Manager) error { - ctx.VMProviderA2 = intgFakeVMProvider + ctx.VMProvider = intgFakeVMProvider return nil }, ) diff --git a/controllers/infra/secret/infra_secret_controller.go b/controllers/infra/secret/infra_secret_controller.go index 5b808dc98..788febe53 100644 --- a/controllers/infra/secret/infra_secret_controller.go +++ b/controllers/infra/secret/infra_secret_controller.go @@ -49,7 +49,7 @@ func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) er ctrl.Log.WithName("controllers").WithName(controllerName), record.New(mgr.GetEventRecorderFor(controllerNameLong)), ctx.Namespace, - ctx.VMProviderA2, + ctx.VMProvider, ) c, err := controller.New(controllerName, mgr, controller.Options{Reconciler: r}) diff --git a/controllers/infra/secret/infra_secret_controller_intg_test.go b/controllers/infra/secret/infra_secret_controller_intg_test.go index 8011d5a4c..29f0772f9 100644 --- a/controllers/infra/secret/infra_secret_controller_intg_test.go +++ b/controllers/infra/secret/infra_secret_controller_intg_test.go @@ -25,7 +25,7 @@ func intgTests() { Label( testlabels.Controller, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), intgTestsReconcile, ) diff --git a/controllers/infra/secret/infra_secret_controller_suite_test.go b/controllers/infra/secret/infra_secret_controller_suite_test.go index 853caede4..50f69d11f 100644 --- a/controllers/infra/secret/infra_secret_controller_suite_test.go +++ b/controllers/infra/secret/infra_secret_controller_suite_test.go @@ -16,12 +16,12 @@ import ( "github.com/vmware-tanzu/vm-operator/test/builder" ) -var provider = providerfake.NewVMProviderA2() +var provider = providerfake.NewVMProvider() var suite = builder.NewTestSuiteForController( secret.AddToManager, func(ctx *ctrlContext.ControllerManagerContext, _ ctrlmgr.Manager) error { - ctx.VMProviderA2 = provider + ctx.VMProvider = provider return nil }, ) diff --git a/controllers/virtualmachine/controllers.go b/controllers/virtualmachine/controllers.go deleted file mode 100644 index dff928572..000000000 --- a/controllers/virtualmachine/controllers.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package virtualmachine - -import ( - "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/v1alpha2" - "github.com/vmware-tanzu/vm-operator/pkg/context" -) - -// AddToManager adds the controller to the provided manager. -func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) error { - return v1alpha2.AddToManager(ctx, mgr) -} diff --git a/controllers/virtualmachine/v1alpha2/virtualmachine_controller.go b/controllers/virtualmachine/virtualmachine_controller.go similarity index 96% rename from controllers/virtualmachine/v1alpha2/virtualmachine_controller.go rename to controllers/virtualmachine/virtualmachine_controller.go index 9372dfa67..08017a18b 100644 --- a/controllers/virtualmachine/v1alpha2/virtualmachine_controller.go +++ b/controllers/virtualmachine/virtualmachine_controller.go @@ -1,7 +1,7 @@ -// Copyright (c) 2019-2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2019-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2 +package virtualmachine import ( goctx "context" @@ -23,7 +23,7 @@ import ( "github.com/go-logr/logr" "github.com/pkg/errors" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/conditions" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" @@ -56,7 +56,7 @@ func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) er controllerNameLong = fmt.Sprintf("%s/%s/%s", ctx.Namespace, ctx.Name, controllerNameShort) ) - proberManager, err := prober.AddToManager(mgr, ctx.VMProviderA2) + proberManager, err := prober.AddToManager(mgr, ctx.VMProvider) if err != nil { return err } @@ -66,7 +66,7 @@ func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) er mgr.GetClient(), ctrl.Log.WithName("controllers").WithName(controlledTypeName), record.New(mgr.GetEventRecorderFor(controllerNameLong)), - ctx.VMProviderA2, + ctx.VMProvider, proberManager) // isDefaultVMClassController is used to configure watches and predicates @@ -160,7 +160,7 @@ func NewReconciler( client client.Client, logger logr.Logger, recorder record.Recorder, - vmProvider vmprovider.VirtualMachineProviderInterfaceA2, + vmProvider vmprovider.VirtualMachineProviderInterface, prober prober.Manager) *Reconciler { return &Reconciler{ @@ -180,7 +180,7 @@ type Reconciler struct { Context goctx.Context Logger logr.Logger Recorder record.Recorder - VMProvider vmprovider.VirtualMachineProviderInterfaceA2 + VMProvider vmprovider.VirtualMachineProviderInterface Prober prober.Manager vmMetrics *metrics.VMMetrics } @@ -205,7 +205,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Resu return ctrl.Result{}, client.IgnoreNotFound(err) } - vmCtx := &context.VirtualMachineContextA2{ + vmCtx := &context.VirtualMachineContext{ Context: ctx, Logger: ctrl.Log.WithName("VirtualMachine").WithValues("name", vm.NamespacedName()), VM: vm, @@ -254,7 +254,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Resu // TODO: It would be much preferable to determine that a non-error resync is required at the source of the determination that // TODO: the VM IP isn't available rather than up here in the reconcile loop. However, in the interest of time, we are making // TODO: this determination here and will have to refactor at some later date. -func requeueDelay(ctx *context.VirtualMachineContextA2) time.Duration { +func requeueDelay(ctx *context.VirtualMachineContext) time.Duration { // If the VM is in Creating phase, the reconciler has run out of threads to Create VMs on the provider. Do not queue // immediately to avoid exponential backoff. if conditions.IsFalse(ctx.VM, vmopv1.VirtualMachineConditionCreated) { @@ -271,7 +271,7 @@ func requeueDelay(ctx *context.VirtualMachineContextA2) time.Duration { return 0 } -func (r *Reconciler) ReconcileDelete(ctx *context.VirtualMachineContextA2) (reterr error) { +func (r *Reconciler) ReconcileDelete(ctx *context.VirtualMachineContext) (reterr error) { ctx.Logger.Info("Reconciling VirtualMachine Deletion") if controllerutil.ContainsFinalizer(ctx.VM, finalizerName) { @@ -297,7 +297,7 @@ func (r *Reconciler) ReconcileDelete(ctx *context.VirtualMachineContextA2) (rete } // ReconcileNormal processes a level trigger for this VM: create if it doesn't exist otherwise update the existing VM. -func (r *Reconciler) ReconcileNormal(ctx *context.VirtualMachineContextA2) (reterr error) { +func (r *Reconciler) ReconcileNormal(ctx *context.VirtualMachineContext) (reterr error) { if !controllerutil.ContainsFinalizer(ctx.VM, finalizerName) { // The finalizer must be present before proceeding in order to ensure that the VM will // be cleaned up. Return immediately after here to let the patcher helper update the diff --git a/controllers/virtualmachine/v1alpha2/virtualmachine_controller_intg_test.go b/controllers/virtualmachine/virtualmachine_controller_intg_test.go similarity index 97% rename from controllers/virtualmachine/v1alpha2/virtualmachine_controller_intg_test.go rename to controllers/virtualmachine/virtualmachine_controller_intg_test.go index 0f37803bb..2b9af3ddd 100644 --- a/controllers/virtualmachine/v1alpha2/virtualmachine_controller_intg_test.go +++ b/controllers/virtualmachine/virtualmachine_controller_intg_test.go @@ -1,7 +1,7 @@ -// Copyright (c) 2020 VMware, Inc. All Rights Reserved. +// Copyright (c) 2020-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachine_test import ( "context" @@ -16,7 +16,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -28,7 +28,7 @@ func intgTests() { Label( testlabels.Controller, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), intgTestsReconcile, ) diff --git a/controllers/virtualmachine/v1alpha2/virtualmachine_controller_suite_test.go b/controllers/virtualmachine/virtualmachine_controller_suite_test.go similarity index 80% rename from controllers/virtualmachine/v1alpha2/virtualmachine_controller_suite_test.go rename to controllers/virtualmachine/virtualmachine_controller_suite_test.go index 1bf90076e..4d3d57759 100644 --- a/controllers/virtualmachine/v1alpha2/virtualmachine_controller_suite_test.go +++ b/controllers/virtualmachine/virtualmachine_controller_suite_test.go @@ -1,7 +1,7 @@ // Copyright (c) 2019-2020 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachine_test import ( "testing" @@ -10,20 +10,20 @@ import ( ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" - virtualmachine "github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/v1alpha2" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachine" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" ctrlContext "github.com/vmware-tanzu/vm-operator/pkg/context" providerfake "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/fake" "github.com/vmware-tanzu/vm-operator/test/builder" ) -var intgFakeVMProvider = providerfake.NewVMProviderA2() +var intgFakeVMProvider = providerfake.NewVMProvider() var suite = builder.NewTestSuiteForControllerWithContext( pkgconfig.NewContextWithDefaultConfig(), virtualmachine.AddToManager, func(ctx *ctrlContext.ControllerManagerContext, _ ctrlmgr.Manager) error { - ctx.VMProviderA2 = intgFakeVMProvider + ctx.VMProvider = intgFakeVMProvider return nil }) diff --git a/controllers/virtualmachine/v1alpha2/virtualmachine_controller_unit_test.go b/controllers/virtualmachine/virtualmachine_controller_unit_test.go similarity index 93% rename from controllers/virtualmachine/v1alpha2/virtualmachine_controller_unit_test.go rename to controllers/virtualmachine/virtualmachine_controller_unit_test.go index fddf4d30c..c959a4120 100644 --- a/controllers/virtualmachine/v1alpha2/virtualmachine_controller_unit_test.go +++ b/controllers/virtualmachine/virtualmachine_controller_unit_test.go @@ -1,7 +1,7 @@ // Copyright (c) 2019-2021 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachine_test import ( "context" @@ -14,9 +14,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" - virtualmachine "github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/v1alpha2" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachine" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" vmopContext "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -32,7 +32,7 @@ func unitTests() { "Reconcile", Label( testlabels.Controller, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), unitTestsReconcile, ) @@ -48,10 +48,10 @@ func unitTestsReconcile() { ctx *builder.UnitTestContextForController reconciler *virtualmachine.Reconciler fakeProbeManager *proberfake.ProberManager - fakeVMProvider *providerfake.VMProviderA2 + fakeVMProvider *providerfake.VMProvider vm *vmopv1.VirtualMachine - vmCtx *vmopContext.VirtualMachineContextA2 + vmCtx *vmopContext.VirtualMachineContext ) BeforeEach(func() { @@ -82,12 +82,12 @@ func unitTestsReconcile() { ctx.Client, ctx.Logger, ctx.Recorder, - ctx.VMProviderA2, + ctx.VMProvider, fakeProbeManagerIf) - fakeVMProvider = ctx.VMProviderA2.(*providerfake.VMProviderA2) + fakeVMProvider = ctx.VMProvider.(*providerfake.VMProvider) fakeProbeManager = fakeProbeManagerIf.(*proberfake.ProberManager) - vmCtx = &vmopContext.VirtualMachineContextA2{ + vmCtx = &vmopContext.VirtualMachineContext{ Context: ctx, Logger: ctx.Logger.WithName(vm.Name), VM: vm, diff --git a/controllers/virtualmachineclass/controllers.go b/controllers/virtualmachineclass/controllers.go deleted file mode 100644 index e744a0a22..000000000 --- a/controllers/virtualmachineclass/controllers.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package virtualmachineclass - -import ( - "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineclass/v1alpha2" - "github.com/vmware-tanzu/vm-operator/pkg/context" -) - -// AddToManager adds the controller to the provided manager. -func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) error { - return v1alpha2.AddToManager(ctx, mgr) -} diff --git a/controllers/virtualmachineclass/v1alpha2/virtualmachineclass_controller.go b/controllers/virtualmachineclass/virtualmachineclass_controller.go similarity index 93% rename from controllers/virtualmachineclass/v1alpha2/virtualmachineclass_controller.go rename to controllers/virtualmachineclass/virtualmachineclass_controller.go index a2de5a9b5..aea6329ef 100644 --- a/controllers/virtualmachineclass/v1alpha2/virtualmachineclass_controller.go +++ b/controllers/virtualmachineclass/virtualmachineclass_controller.go @@ -1,7 +1,7 @@ -// Copyright (c) 2020-2021 VMware, Inc. All Rights Reserved. +// Copyright (c) 2020-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2 +package virtualmachineclass import ( goctx "context" @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/manager" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/patch" @@ -77,7 +77,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Resu return ctrl.Result{}, client.IgnoreNotFound(err) } - vmClassCtx := &context.VirtualMachineClassContextA2{ + vmClassCtx := &context.VirtualMachineClassContext{ Context: ctx, Logger: ctrl.Log.WithName("VirtualMachineClass").WithValues("name", req.Name), VMClass: vmClass, @@ -109,6 +109,6 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Resu return ctrl.Result{}, nil } -func (r *Reconciler) ReconcileNormal(vmClassCtx *context.VirtualMachineClassContextA2) error { +func (r *Reconciler) ReconcileNormal(vmClassCtx *context.VirtualMachineClassContext) error { return nil } diff --git a/controllers/virtualmachineclass/v1alpha2/virtualmachineclass_controller_intg_test.go b/controllers/virtualmachineclass/virtualmachineclass_controller_intg_test.go similarity index 90% rename from controllers/virtualmachineclass/v1alpha2/virtualmachineclass_controller_intg_test.go rename to controllers/virtualmachineclass/virtualmachineclass_controller_intg_test.go index 140198185..d4b89f624 100644 --- a/controllers/virtualmachineclass/v1alpha2/virtualmachineclass_controller_intg_test.go +++ b/controllers/virtualmachineclass/virtualmachineclass_controller_intg_test.go @@ -1,7 +1,7 @@ -// Copyright (c) 2020 VMware, Inc. All Rights Reserved. +// Copyright (c) 2020-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachineclass_test import ( . "github.com/onsi/ginkgo/v2" @@ -11,7 +11,7 @@ import ( "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -22,7 +22,7 @@ func intgTests() { Label( testlabels.Controller, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), intgTestsReconcile, ) diff --git a/controllers/virtualmachineclass/v1alpha2/virtualmachineclass_controller_suite_test.go b/controllers/virtualmachineclass/virtualmachineclass_controller_suite_test.go similarity index 78% rename from controllers/virtualmachineclass/v1alpha2/virtualmachineclass_controller_suite_test.go rename to controllers/virtualmachineclass/virtualmachineclass_controller_suite_test.go index b909fa74a..906189a7d 100644 --- a/controllers/virtualmachineclass/v1alpha2/virtualmachineclass_controller_suite_test.go +++ b/controllers/virtualmachineclass/virtualmachineclass_controller_suite_test.go @@ -1,14 +1,14 @@ -// Copyright (c) 2020 VMware, Inc. All Rights Reserved. +// Copyright (c) 2020-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachineclass_test import ( "testing" . "github.com/onsi/ginkgo/v2" - virtualmachineclass "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineclass/v1alpha2" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineclass" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/manager" "github.com/vmware-tanzu/vm-operator/test/builder" diff --git a/controllers/virtualmachineclass/v1alpha2/virtualmachineclass_controller_unit_test.go b/controllers/virtualmachineclass/virtualmachineclass_controller_unit_test.go similarity index 78% rename from controllers/virtualmachineclass/v1alpha2/virtualmachineclass_controller_unit_test.go rename to controllers/virtualmachineclass/virtualmachineclass_controller_unit_test.go index b6e832b76..a1e0b3d19 100644 --- a/controllers/virtualmachineclass/v1alpha2/virtualmachineclass_controller_unit_test.go +++ b/controllers/virtualmachineclass/virtualmachineclass_controller_unit_test.go @@ -1,7 +1,7 @@ -// Copyright (c) 2020-2021 VMware, Inc. All Rights Reserved. +// Copyright (c) 2020-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachineclass_test import ( . "github.com/onsi/ginkgo/v2" @@ -10,9 +10,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" - virtualmachineclass "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineclass/v1alpha2" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineclass" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" vmopContext "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -23,7 +23,7 @@ func unitTests() { "Reconcile", Label( testlabels.Controller, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), unitTestsReconcile, ) @@ -35,7 +35,7 @@ func unitTestsReconcile() { ctx *builder.UnitTestContextForController reconciler *virtualmachineclass.Reconciler - vmClassCtx *vmopContext.VirtualMachineClassContextA2 + vmClassCtx *vmopContext.VirtualMachineClassContext vmClass *vmopv1.VirtualMachineClass ) @@ -56,7 +56,7 @@ func unitTestsReconcile() { ctx.Recorder, ) - vmClassCtx = &vmopContext.VirtualMachineClassContextA2{ + vmClassCtx = &vmopContext.VirtualMachineClassContext{ Context: ctx, Logger: ctx.Logger.WithName(vmClass.Name), VMClass: vmClass, diff --git a/controllers/virtualmachinepublishrequest/controllers.go b/controllers/virtualmachinepublishrequest/controllers.go deleted file mode 100644 index a788e2655..000000000 --- a/controllers/virtualmachinepublishrequest/controllers.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package virtualmachinepublishrequest - -import ( - "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest/v1alpha2" - "github.com/vmware-tanzu/vm-operator/pkg/context" -) - -// AddToManager adds the controller to the provided manager. -func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) error { - return v1alpha2.AddToManager(ctx, mgr) -} diff --git a/controllers/virtualmachinepublishrequest/v1alpha2/virtualmachinepublishrequest_controller.go b/controllers/virtualmachinepublishrequest/virtualmachinepublishrequest_controller.go similarity index 96% rename from controllers/virtualmachinepublishrequest/v1alpha2/virtualmachinepublishrequest_controller.go rename to controllers/virtualmachinepublishrequest/virtualmachinepublishrequest_controller.go index 9096fe328..f036ac1ed 100644 --- a/controllers/virtualmachinepublishrequest/v1alpha2/virtualmachinepublishrequest_controller.go +++ b/controllers/virtualmachinepublishrequest/virtualmachinepublishrequest_controller.go @@ -1,7 +1,7 @@ -// Copyright (c) 2022-2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2022-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2 +package virtualmachinepublishrequest import ( goctx "context" @@ -29,7 +29,7 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/conditions" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -79,7 +79,7 @@ func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) er mgr.GetAPIReader(), ctrl.Log.WithName("controllers").WithName(controlledTypeName), record.New(mgr.GetEventRecorderFor(controllerNameLong)), - ctx.VMProviderA2, + ctx.VMProvider, ) return ctrl.NewControllerManagedBy(mgr). @@ -134,7 +134,7 @@ func NewReconciler( apiReader client.Reader, logger logr.Logger, recorder record.Recorder, - vmProvider vmprovider.VirtualMachineProviderInterfaceA2) *Reconciler { + vmProvider vmprovider.VirtualMachineProviderInterface) *Reconciler { return &Reconciler{ Context: ctx, @@ -154,11 +154,11 @@ type Reconciler struct { apiReader client.Reader Logger logr.Logger Recorder record.Recorder - VMProvider vmprovider.VirtualMachineProviderInterfaceA2 + VMProvider vmprovider.VirtualMachineProviderInterface Metrics *metrics.VMPublishMetrics } -func requeueResult(ctx *context.VirtualMachinePublishRequestContextA2) ctrl.Result { +func requeueResult(ctx *context.VirtualMachinePublishRequestContext) ctrl.Result { vmPubReq := ctx.VMPublishRequest // no need to requeue to trigger another reconcile if: @@ -209,7 +209,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Resu return ctrl.Result{}, client.IgnoreNotFound(err) } - vmPublishCtx := &context.VirtualMachinePublishRequestContextA2{ + vmPublishCtx := &context.VirtualMachinePublishRequestContext{ Context: ctx, Logger: ctrl.Log.WithName("VirtualMachinePublishRequest").WithValues("name", req.NamespacedName), VMPublishRequest: vmPublishReq, @@ -242,7 +242,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Resu return r.ReconcileNormal(vmPublishCtx) } -func (r *Reconciler) updateSourceAndTargetRef(ctx *context.VirtualMachinePublishRequestContextA2) { +func (r *Reconciler) updateSourceAndTargetRef(ctx *context.VirtualMachinePublishRequestContext) { vmPubReq := ctx.VMPublishRequest if vmPubReq.Status.SourceRef == nil { @@ -273,7 +273,7 @@ func (r *Reconciler) updateSourceAndTargetRef(ctx *context.VirtualMachinePublish } // publishVirtualMachine checks if source VM and target is valid. Publish a VM if all requirements are met. -func (r *Reconciler) publishVirtualMachine(ctx *context.VirtualMachinePublishRequestContextA2) error { +func (r *Reconciler) publishVirtualMachine(ctx *context.VirtualMachinePublishRequestContext) error { vmPublishReq := ctx.VMPublishRequest // Check if the source and target is valid if err := r.checkIsSourceValid(ctx); err != nil { @@ -327,7 +327,7 @@ func (r *Reconciler) publishVirtualMachine(ctx *context.VirtualMachinePublishReq return nil } -func (r *Reconciler) removeVMPubResourceFromCluster(ctx *context.VirtualMachinePublishRequestContextA2) (requeueAfter time.Duration, +func (r *Reconciler) removeVMPubResourceFromCluster(ctx *context.VirtualMachinePublishRequestContext) (requeueAfter time.Duration, deleted bool, err error) { vmPublishReq := ctx.VMPublishRequest @@ -358,7 +358,7 @@ func (r *Reconciler) removeVMPubResourceFromCluster(ctx *context.VirtualMachineP // checkIsSourceValid function checks if the source VM is valid. It is invalid if the VM k8s resource // doesn't exist, or is not in Created phase. -func (r *Reconciler) checkIsSourceValid(ctx *context.VirtualMachinePublishRequestContextA2) error { +func (r *Reconciler) checkIsSourceValid(ctx *context.VirtualMachinePublishRequestContext) error { vmPubReq := ctx.VMPublishRequest vm := &vmopv1.VirtualMachine{} objKey := client.ObjectKey{Name: vmPubReq.Status.SourceRef.Name, Namespace: vmPubReq.Namespace} @@ -390,7 +390,7 @@ func (r *Reconciler) checkIsSourceValid(ctx *context.VirtualMachinePublishReques // checkIsTargetValid checks if the target item is valid. // It is invalid if the content library doesn't exist, an item with the same name in the CL exists. -func (r *Reconciler) checkIsTargetValid(ctx *context.VirtualMachinePublishRequestContextA2) error { +func (r *Reconciler) checkIsTargetValid(ctx *context.VirtualMachinePublishRequestContext) error { vmPubReq := ctx.VMPublishRequest contentLibrary := &imgregv1a1.ContentLibrary{} targetLocationName := vmPubReq.Spec.Target.Location.Name @@ -474,7 +474,7 @@ func (r *Reconciler) checkIsTargetValid(ctx *context.VirtualMachinePublishReques } // checkIsImageAvailable checks if the published VirtualMachineImage resource is available in the cluster. -func (r *Reconciler) checkIsImageAvailable(ctx *context.VirtualMachinePublishRequestContextA2) error { +func (r *Reconciler) checkIsImageAvailable(ctx *context.VirtualMachinePublishRequestContext) error { if !conditions.IsTrue(ctx.VMPublishRequest, vmopv1.VirtualMachinePublishRequestConditionUploaded) { return nil } @@ -521,7 +521,7 @@ func (r *Reconciler) checkIsImageAvailable(ctx *context.VirtualMachinePublishReq // checkIsComplete checks if condition Complete can be marked to true. // The condition's status is set to true only when all other conditions present on the resource have a truthy status. -func (r *Reconciler) checkIsComplete(ctx *context.VirtualMachinePublishRequestContextA2) bool { +func (r *Reconciler) checkIsComplete(ctx *context.VirtualMachinePublishRequestContext) bool { if conditions.IsTrue(ctx.VMPublishRequest, vmopv1.VirtualMachinePublishRequestConditionComplete) { return true } @@ -551,7 +551,7 @@ func (r *Reconciler) checkIsComplete(ctx *context.VirtualMachinePublishRequestCo } // getPublishRequestTask gets task with description id com.vmware.ovfs.LibraryItem.capture and specified actid in taskManager. -func (r *Reconciler) getPublishRequestTask(ctx *context.VirtualMachinePublishRequestContextA2) (*vimtypes.TaskInfo, error) { +func (r *Reconciler) getPublishRequestTask(ctx *context.VirtualMachinePublishRequestContext) (*vimtypes.TaskInfo, error) { actID := getPublishRequestActID(ctx.VMPublishRequest) logger := ctx.Logger.WithValues("activationID", actID) @@ -588,7 +588,7 @@ func (r *Reconciler) getPublishRequestTask(ctx *context.VirtualMachinePublishReq // - If this task is queued/running, then we should mark Uploaded to false and no need to retry VM publish. // - task succeeded, mark Uploaded to true and return the uploaded item ID. // - task failed, mark Uploaded to false and retry the operation. -func (r *Reconciler) checkPubReqStatusAndShouldRepublish(ctx *context.VirtualMachinePublishRequestContextA2) (bool, error) { +func (r *Reconciler) checkPubReqStatusAndShouldRepublish(ctx *context.VirtualMachinePublishRequestContext) (bool, error) { if ctx.VMPublishRequest.Status.Attempts == 0 { // No VM publish task has been attempted. return immediately. return true, nil @@ -681,7 +681,7 @@ func (r *Reconciler) checkPubReqStatusAndShouldRepublish(ctx *context.VirtualMac return false, nil } -func (r *Reconciler) processUploadedItem(ctx *context.VirtualMachinePublishRequestContextA2, task *vimtypes.TaskInfo) { +func (r *Reconciler) processUploadedItem(ctx *context.VirtualMachinePublishRequestContext, task *vimtypes.TaskInfo) { itemID, err := parseItemIDFromTaskResult(task.Result) if err != nil { // Don't return err here because the task result won't be updated, the error will persist. @@ -700,7 +700,7 @@ func (r *Reconciler) processUploadedItem(ctx *context.VirtualMachinePublishReque } // getUploadedItemID returns the uploaded content library item ID. -func (r *Reconciler) getUploadedItemID(ctx *context.VirtualMachinePublishRequestContextA2) (string, error) { +func (r *Reconciler) getUploadedItemID(ctx *context.VirtualMachinePublishRequestContext) (string, error) { task, err := r.getPublishRequestTask(ctx) if err != nil { return "", err @@ -725,7 +725,7 @@ func (r *Reconciler) getUploadedItemID(ctx *context.VirtualMachinePublishRequest // waiting time window but a new task with a new actID is already triggered), // we'll get stuck if any previous task succeeds because all tasks afterwards // would fail due to item duplication error. -func (r *Reconciler) isItemCorrelatedWithVMPub(ctx *context.VirtualMachinePublishRequestContextA2, +func (r *Reconciler) isItemCorrelatedWithVMPub(ctx *context.VirtualMachinePublishRequestContext, item *library.Item) bool { if item.Description != nil { descriptions := itemDescriptionReg.FindStringSubmatch(*item.Description) @@ -738,7 +738,7 @@ func (r *Reconciler) isItemCorrelatedWithVMPub(ctx *context.VirtualMachinePublis } // findCorrelatedItemIDByName finds the published item ID in the VC by target item name. -func (r *Reconciler) findCorrelatedItemIDByName(ctx *context.VirtualMachinePublishRequestContextA2) (string, error) { +func (r *Reconciler) findCorrelatedItemIDByName(ctx *context.VirtualMachinePublishRequestContext) (string, error) { targetItemName := ctx.VMPublishRequest.Status.TargetRef.Item.Name // We only get ContentLibrary when checking TargetValid condition, // so this ctx.ContentLibrary can be nil in other cases. @@ -776,7 +776,7 @@ func (r *Reconciler) findCorrelatedItemIDByName(ctx *context.VirtualMachinePubli } // updatePublishedItemDescription updates item description, which removes vmPub UUID from it. -func (r *Reconciler) updatePublishedItemDescription(ctx *context.VirtualMachinePublishRequestContextA2) error { +func (r *Reconciler) updatePublishedItemDescription(ctx *context.VirtualMachinePublishRequestContext) error { if !conditions.IsTrue(ctx.VMPublishRequest, vmopv1.VirtualMachinePublishRequestConditionImageAvailable) { return nil } @@ -827,7 +827,7 @@ func parseItemIDFromTaskResult(result vimtypes.AnyType) (string, error) { return clItem.Value[len(clItemPrefix):], nil } -func (r *Reconciler) ReconcileNormal(ctx *context.VirtualMachinePublishRequestContextA2) (_ ctrl.Result, reterr error) { +func (r *Reconciler) ReconcileNormal(ctx *context.VirtualMachinePublishRequestContext) (_ ctrl.Result, reterr error) { ctx.Logger.Info("Reconciling VirtualMachinePublishRequest") vmPublishReq := ctx.VMPublishRequest @@ -911,7 +911,7 @@ func (r *Reconciler) ReconcileNormal(ctx *context.VirtualMachinePublishRequestCo return requeueResult(ctx), nil } -func (r *Reconciler) ReconcileDelete(ctx *context.VirtualMachinePublishRequestContextA2) (ctrl.Result, error) { +func (r *Reconciler) ReconcileDelete(ctx *context.VirtualMachinePublishRequestContext) (ctrl.Result, error) { if controllerutil.ContainsFinalizer(ctx.VMPublishRequest, finalizerName) { r.Metrics.DeleteMetrics(ctx.Logger, ctx.VMPublishRequest.Name, ctx.VMPublishRequest.Namespace) controllerutil.RemoveFinalizer(ctx.VMPublishRequest, finalizerName) diff --git a/controllers/virtualmachinepublishrequest/v1alpha2/virtualmachinepublishrequest_controller_intg_test.go b/controllers/virtualmachinepublishrequest/virtualmachinepublishrequest_controller_intg_test.go similarity index 96% rename from controllers/virtualmachinepublishrequest/v1alpha2/virtualmachinepublishrequest_controller_intg_test.go rename to controllers/virtualmachinepublishrequest/virtualmachinepublishrequest_controller_intg_test.go index 2849eba14..73bce7a56 100644 --- a/controllers/virtualmachinepublishrequest/v1alpha2/virtualmachinepublishrequest_controller_intg_test.go +++ b/controllers/virtualmachinepublishrequest/virtualmachinepublishrequest_controller_intg_test.go @@ -1,7 +1,7 @@ -// Copyright (c) 2022-2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2022-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachinepublishrequest_test import ( "context" @@ -19,9 +19,9 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/utils" - virtualmachinepublishrequest "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -33,7 +33,7 @@ func intgTests() { Label( testlabels.Controller, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), intgTestsReconcile, ) diff --git a/controllers/virtualmachinepublishrequest/v1alpha2/virtualmachinepublishrequest_controller_suite_test.go b/controllers/virtualmachinepublishrequest/virtualmachinepublishrequest_controller_suite_test.go similarity index 74% rename from controllers/virtualmachinepublishrequest/v1alpha2/virtualmachinepublishrequest_controller_suite_test.go rename to controllers/virtualmachinepublishrequest/virtualmachinepublishrequest_controller_suite_test.go index 143e42041..8e648f30a 100644 --- a/controllers/virtualmachinepublishrequest/v1alpha2/virtualmachinepublishrequest_controller_suite_test.go +++ b/controllers/virtualmachinepublishrequest/virtualmachinepublishrequest_controller_suite_test.go @@ -1,7 +1,7 @@ -// Copyright (c) 2022 VMware, Inc. All Rights Reserved. +// Copyright (c) 2022-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachinepublishrequest_test import ( "testing" @@ -10,20 +10,20 @@ import ( ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" - virtualmachinepublishrequest "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest/v1alpha2" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" ctrlContext "github.com/vmware-tanzu/vm-operator/pkg/context" providerfake "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/fake" "github.com/vmware-tanzu/vm-operator/test/builder" ) -var intgFakeVMProvider = providerfake.NewVMProviderA2() +var intgFakeVMProvider = providerfake.NewVMProvider() var suite = builder.NewTestSuiteForControllerWithContext( pkgconfig.NewContextWithDefaultConfig(), virtualmachinepublishrequest.AddToManager, func(ctx *ctrlContext.ControllerManagerContext, _ ctrlmgr.Manager) error { - ctx.VMProviderA2 = intgFakeVMProvider + ctx.VMProvider = intgFakeVMProvider return nil }) diff --git a/controllers/virtualmachinepublishrequest/v1alpha2/virtualmachinepublishrequest_controller_unit_test.go b/controllers/virtualmachinepublishrequest/virtualmachinepublishrequest_controller_unit_test.go similarity index 97% rename from controllers/virtualmachinepublishrequest/v1alpha2/virtualmachinepublishrequest_controller_unit_test.go rename to controllers/virtualmachinepublishrequest/virtualmachinepublishrequest_controller_unit_test.go index 610e07528..f6671a04f 100644 --- a/controllers/virtualmachinepublishrequest/v1alpha2/virtualmachinepublishrequest_controller_unit_test.go +++ b/controllers/virtualmachinepublishrequest/virtualmachinepublishrequest_controller_unit_test.go @@ -1,7 +1,7 @@ -// Copyright (c) 2022-2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2022-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachinepublishrequest_test import ( goctx "context" @@ -22,8 +22,8 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - virtualmachinepublishrequest "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" vmopContext "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -38,7 +38,7 @@ func unitTests() { "Reconcile", Label( testlabels.Controller, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), unitTestsReconcile, ) @@ -50,12 +50,12 @@ func unitTestsReconcile() { ctx *builder.UnitTestContextForController reconciler *virtualmachinepublishrequest.Reconciler - fakeVMProvider *providerfake.VMProviderA2 + fakeVMProvider *providerfake.VMProvider vm *vmopv1.VirtualMachine vmpub *vmopv1.VirtualMachinePublishRequest cl *imgregv1a1.ContentLibrary - vmpubCtx *vmopContext.VirtualMachinePublishRequestContextA2 + vmpubCtx *vmopContext.VirtualMachinePublishRequestContext ) BeforeEach(func() { @@ -81,12 +81,12 @@ func unitTestsReconcile() { ctx.Client, ctx.Logger, ctx.Recorder, - ctx.VMProviderA2, + ctx.VMProvider, ) - fakeVMProvider = ctx.VMProviderA2.(*providerfake.VMProviderA2) + fakeVMProvider = ctx.VMProvider.(*providerfake.VMProvider) fakeVMProvider.Reset() - vmpubCtx = &vmopContext.VirtualMachinePublishRequestContextA2{ + vmpubCtx = &vmopContext.VirtualMachinePublishRequestContext{ Context: ctx, Logger: ctx.Logger.WithName(vmpub.Name), VMPublishRequest: vmpub, diff --git a/controllers/virtualmachineservice/controllers.go b/controllers/virtualmachineservice/controllers.go deleted file mode 100644 index 28a9c90ca..000000000 --- a/controllers/virtualmachineservice/controllers.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package virtualmachineservice - -import ( - "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha2" - "github.com/vmware-tanzu/vm-operator/pkg/context" -) - -// AddToManager adds the controller to the provided manager. -func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) error { - return v1alpha2.AddToManager(ctx, mgr) -} diff --git a/controllers/virtualmachineservice/v1alpha2/providers/loadbalancer_provider.go b/controllers/virtualmachineservice/providers/loadbalancer_provider.go similarity index 98% rename from controllers/virtualmachineservice/v1alpha2/providers/loadbalancer_provider.go rename to controllers/virtualmachineservice/providers/loadbalancer_provider.go index 9d6268e0e..44f380952 100644 --- a/controllers/virtualmachineservice/v1alpha2/providers/loadbalancer_provider.go +++ b/controllers/virtualmachineservice/providers/loadbalancer_provider.go @@ -9,9 +9,9 @@ import ( corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/manager" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" - "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha2/utils" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/utils" ) const ( diff --git a/controllers/virtualmachineservice/v1alpha2/providers/loadbalancer_provider_suite_test.go b/controllers/virtualmachineservice/providers/loadbalancer_provider_suite_test.go similarity index 100% rename from controllers/virtualmachineservice/v1alpha2/providers/loadbalancer_provider_suite_test.go rename to controllers/virtualmachineservice/providers/loadbalancer_provider_suite_test.go diff --git a/controllers/virtualmachineservice/v1alpha2/providers/loadbalancer_provider_test.go b/controllers/virtualmachineservice/providers/loadbalancer_provider_test.go similarity index 98% rename from controllers/virtualmachineservice/v1alpha2/providers/loadbalancer_provider_test.go rename to controllers/virtualmachineservice/providers/loadbalancer_provider_test.go index 4b223ca64..d1958f5f5 100644 --- a/controllers/virtualmachineservice/v1alpha2/providers/loadbalancer_provider_test.go +++ b/controllers/virtualmachineservice/providers/loadbalancer_provider_test.go @@ -12,8 +12,8 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha2/utils" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/utils" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" ) @@ -23,7 +23,7 @@ const ( var _ = Describe( "Loadbalancer Provider", - Label(testlabels.Controller, testlabels.V1Alpha2), + Label(testlabels.Controller, testlabels.V1Alpha3), func() { var ( ctx context.Context diff --git a/controllers/virtualmachineservice/v1alpha2/utils/constants.go b/controllers/virtualmachineservice/utils/constants.go similarity index 100% rename from controllers/virtualmachineservice/v1alpha2/utils/constants.go rename to controllers/virtualmachineservice/utils/constants.go diff --git a/controllers/virtualmachineservice/v1alpha2/utils/endpoints.go b/controllers/virtualmachineservice/utils/endpoints.go similarity index 82% rename from controllers/virtualmachineservice/v1alpha2/utils/endpoints.go rename to controllers/virtualmachineservice/utils/endpoints.go index 787b1022c..367af3689 100644 --- a/controllers/virtualmachineservice/v1alpha2/utils/endpoints.go +++ b/controllers/virtualmachineservice/utils/endpoints.go @@ -14,12 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Package utils is for helping with endpoints. +// +//nolint:gosec +package utils + // Imported https://github.com/kubernetes/kubernetes/blob/master/pkg/api/v1/endpoints/util.go // to avoid depending on k8s.io/kubernetes -//nolint: gosec -package utils - import ( "bytes" "crypto/md5" @@ -28,7 +30,7 @@ import ( "sort" "github.com/davecgh/go-spew/spew" - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" ) @@ -43,22 +45,22 @@ func DeepHashObject(hasher hash.Hash, objectToWrite interface{}) { DisableMethods: true, SpewKeys: true, } - printer.Fprintf(hasher, "%#v", objectToWrite) + _, _ = printer.Fprintf(hasher, "%#v", objectToWrite) } // RepackSubsets takes a slice of EndpointSubset objects, expands it to the full // representation, and then repacks that into the canonical layout. This // ensures that code which operates on these objects can rely on the common // form for things like comparison. The result is a newly allocated slice. -func RepackSubsets(subsets []v1.EndpointSubset) []v1.EndpointSubset { +func RepackSubsets(subsets []corev1.EndpointSubset) []corev1.EndpointSubset { // First map each unique port definition to the sets of hosts that // offer it. - allAddrs := map[addressKey]*v1.EndpointAddress{} - portToAddrReadyMap := map[v1.EndpointPort]addressSet{} + allAddrs := map[addressKey]*corev1.EndpointAddress{} + portToAddrReadyMap := map[corev1.EndpointPort]addressSet{} for i := range subsets { if len(subsets[i].Ports) == 0 { // Don't discard endpoints with no ports defined, use a sentinel. - mapAddressesByPort(&subsets[i], v1.EndpointPort{Port: -1}, allAddrs, portToAddrReadyMap) + mapAddressesByPort(&subsets[i], corev1.EndpointPort{Port: -1}, allAddrs, portToAddrReadyMap) } else { for _, port := range subsets[i].Ports { mapAddressesByPort(&subsets[i], port, allAddrs, portToAddrReadyMap) @@ -72,7 +74,7 @@ func RepackSubsets(subsets []v1.EndpointSubset) []v1.EndpointSubset { // associative entity. type keyString string keyToAddrReadyMap := map[keyString]addressSet{} - addrReadyMapKeyToPorts := map[keyString][]v1.EndpointPort{} + addrReadyMapKeyToPorts := map[keyString][]corev1.EndpointPort{} for port, addrs := range portToAddrReadyMap { key := keyString(hashAddresses(addrs)) keyToAddrReadyMap[key] = addrs @@ -85,9 +87,9 @@ func RepackSubsets(subsets []v1.EndpointSubset) []v1.EndpointSubset { } // Next, build the N-to-M association the API wants. - final := []v1.EndpointSubset{} + final := []corev1.EndpointSubset{} for key, ports := range addrReadyMapKeyToPorts { - var readyAddrs, notReadyAddrs []v1.EndpointAddress + var readyAddrs, notReadyAddrs []corev1.EndpointAddress for addr, ready := range keyToAddrReadyMap[key] { if ready { readyAddrs = append(readyAddrs, *addr) @@ -95,7 +97,7 @@ func RepackSubsets(subsets []v1.EndpointSubset) []v1.EndpointSubset { notReadyAddrs = append(notReadyAddrs, *addr) } } - final = append(final, v1.EndpointSubset{Addresses: readyAddrs, NotReadyAddresses: notReadyAddrs, Ports: ports}) + final = append(final, corev1.EndpointSubset{Addresses: readyAddrs, NotReadyAddresses: notReadyAddrs, Ports: ports}) } // Finally, sort it. @@ -109,7 +111,7 @@ type addressKey struct { } // mapAddressesByPort adds all ready and not-ready addresses into a map by a single port. -func mapAddressesByPort(subset *v1.EndpointSubset, port v1.EndpointPort, allAddrs map[addressKey]*v1.EndpointAddress, portToAddrReadyMap map[v1.EndpointPort]addressSet) { +func mapAddressesByPort(subset *corev1.EndpointSubset, port corev1.EndpointPort, allAddrs map[addressKey]*corev1.EndpointAddress, portToAddrReadyMap map[corev1.EndpointPort]addressSet) { for k := range subset.Addresses { mapAddressByPort(&subset.Addresses[k], port, true, allAddrs, portToAddrReadyMap) } @@ -120,7 +122,9 @@ func mapAddressesByPort(subset *v1.EndpointSubset, port v1.EndpointPort, allAddr // mapAddressByPort adds one address into a map by port, registering the address with a unique pointer, and preserving // any existing ready state. -func mapAddressByPort(addr *v1.EndpointAddress, port v1.EndpointPort, ready bool, allAddrs map[addressKey]*v1.EndpointAddress, portToAddrReadyMap map[v1.EndpointPort]addressSet) *v1.EndpointAddress { +// +//nolint:unparam +func mapAddressByPort(addr *corev1.EndpointAddress, port corev1.EndpointPort, ready bool, allAddrs map[addressKey]*corev1.EndpointAddress, portToAddrReadyMap map[corev1.EndpointPort]addressSet) *corev1.EndpointAddress { // use addressKey to distinguish between two endpoints that are identical addresses // but may have come from different hosts, for attribution. For instance, Mesos // assigns pods the node IP, but the pods are distinct. @@ -135,7 +139,7 @@ func mapAddressByPort(addr *v1.EndpointAddress, port v1.EndpointPort, ready bool if existingAddress == nil { // Make a copy so we don't write to the // input args of this function. - existingAddress = &v1.EndpointAddress{} + existingAddress = &corev1.EndpointAddress{} *existingAddress = *addr allAddrs[key] = existingAddress } @@ -153,10 +157,10 @@ func mapAddressByPort(addr *v1.EndpointAddress, port v1.EndpointPort, ready bool return existingAddress } -type addressSet map[*v1.EndpointAddress]bool +type addressSet map[*corev1.EndpointAddress]bool type addrReady struct { - addr *v1.EndpointAddress + addr *corev1.EndpointAddress ready bool } @@ -189,7 +193,7 @@ func (sl addrsReady) Less(i, j int) bool { } // LessEndpointAddress compares IP addresses lexicographically and returns true if first argument is lesser than second. -func LessEndpointAddress(a, b *v1.EndpointAddress) bool { +func LessEndpointAddress(a, b *corev1.EndpointAddress) bool { ipComparison := bytes.Compare([]byte(a.IP), []byte(b.IP)) if ipComparison != 0 { return ipComparison < 0 @@ -205,7 +209,7 @@ func LessEndpointAddress(a, b *v1.EndpointAddress) bool { // SortSubsets sorts an array of EndpointSubset objects in place. For ease of // use it returns the input slice. -func SortSubsets(subsets []v1.EndpointSubset) []v1.EndpointSubset { +func SortSubsets(subsets []corev1.EndpointSubset) []corev1.EndpointSubset { for i := range subsets { ss := &subsets[i] sort.Sort(addrsByIPAndUID(ss.Addresses)) @@ -221,7 +225,7 @@ func hashObject(hasher hash.Hash, obj interface{}) []byte { return hasher.Sum(nil) } -type subsetsByHash []v1.EndpointSubset +type subsetsByHash []corev1.EndpointSubset func (sl subsetsByHash) Len() int { return len(sl) } func (sl subsetsByHash) Swap(i, j int) { sl[i], sl[j] = sl[j], sl[i] } @@ -232,7 +236,7 @@ func (sl subsetsByHash) Less(i, j int) bool { return bytes.Compare(h1, h2) < 0 } -type addrsByIPAndUID []v1.EndpointAddress +type addrsByIPAndUID []corev1.EndpointAddress func (sl addrsByIPAndUID) Len() int { return len(sl) } func (sl addrsByIPAndUID) Swap(i, j int) { sl[i], sl[j] = sl[j], sl[i] } @@ -240,7 +244,7 @@ func (sl addrsByIPAndUID) Less(i, j int) bool { return LessEndpointAddress(&sl[i], &sl[j]) } -type portsByHash []v1.EndpointPort +type portsByHash []corev1.EndpointPort func (sl portsByHash) Len() int { return len(sl) } func (sl portsByHash) Swap(i, j int) { sl[i], sl[j] = sl[j], sl[i] } diff --git a/controllers/virtualmachineservice/v1alpha2/virtualmachineservice_controller.go b/controllers/virtualmachineservice/virtualmachineservice_controller.go similarity index 96% rename from controllers/virtualmachineservice/v1alpha2/virtualmachineservice_controller.go rename to controllers/virtualmachineservice/virtualmachineservice_controller.go index f99169b4a..756b242a6 100644 --- a/controllers/virtualmachineservice/v1alpha2/virtualmachineservice_controller.go +++ b/controllers/virtualmachineservice/virtualmachineservice_controller.go @@ -1,7 +1,7 @@ -// Copyright (c) 2018-2021 VMware, Inc. All Rights Reserved. +// Copyright (c) 2018-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2 +package virtualmachineservice import ( goctx "context" @@ -24,10 +24,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" - "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha2/providers" - "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha2/utils" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/providers" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/utils" "github.com/vmware-tanzu/vm-operator/pkg/conditions" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -127,7 +127,7 @@ func (r *ReconcileVirtualMachineService) Reconcile(ctx goctx.Context, request re return reconcile.Result{}, client.IgnoreNotFound(err) } - vmServiceCtx := &context.VirtualMachineServiceContextA2{ + vmServiceCtx := &context.VirtualMachineServiceContext{ Context: ctx, Logger: ctrl.Log.WithName("VirtualMachineService").WithValues("name", vmService.NamespacedName()), VMService: vmService, @@ -153,7 +153,7 @@ func (r *ReconcileVirtualMachineService) Reconcile(ctx goctx.Context, request re return reconcile.Result{}, r.ReconcileNormal(vmServiceCtx) } -func (r *ReconcileVirtualMachineService) ReconcileDelete(ctx *context.VirtualMachineServiceContextA2) error { +func (r *ReconcileVirtualMachineService) ReconcileDelete(ctx *context.VirtualMachineServiceContext) error { if controllerutil.ContainsFinalizer(ctx.VMService, finalizerName) { objectMeta := metav1.ObjectMeta{ Name: ctx.VMService.Name, @@ -180,7 +180,7 @@ func (r *ReconcileVirtualMachineService) ReconcileDelete(ctx *context.VirtualMac return nil } -func (r *ReconcileVirtualMachineService) ReconcileNormal(ctx *context.VirtualMachineServiceContextA2) error { +func (r *ReconcileVirtualMachineService) ReconcileNormal(ctx *context.VirtualMachineServiceContext) error { if !controllerutil.ContainsFinalizer(ctx.VMService, finalizerName) { controllerutil.AddFinalizer(ctx.VMService, finalizerName) // NOTE: The VirtualMachineService is set as the OwnerReference of the Service and Endpoints. @@ -198,7 +198,7 @@ func (r *ReconcileVirtualMachineService) ReconcileNormal(ctx *context.VirtualMac return nil } -func (r *ReconcileVirtualMachineService) reconcileVMService(ctx *context.VirtualMachineServiceContextA2) error { +func (r *ReconcileVirtualMachineService) reconcileVMService(ctx *context.VirtualMachineServiceContext) error { ctx.Logger.Info("Reconcile VirtualMachineService") defer ctx.Logger.Info("Finished Reconcile VirtualMachineService") @@ -301,7 +301,7 @@ func (r *ReconcileVirtualMachineService) virtualMachineToVirtualMachineServiceMa // Set labels and annotations on the Service from the VirtualMachineService. Some loadbalancer providers (currently // only NCP) need to filter or translate labels and annotations too. func (r *ReconcileVirtualMachineService) setServiceAnnotationsAndLabels( - ctx *context.VirtualMachineServiceContextA2, + ctx *context.VirtualMachineServiceContext, service *corev1.Service) error { vmService := ctx.VMService @@ -372,7 +372,7 @@ func (r *ReconcileVirtualMachineService) setServiceAnnotationsAndLabels( return nil } -func (r *ReconcileVirtualMachineService) createOrUpdateService(ctx *context.VirtualMachineServiceContextA2) (*corev1.Service, error) { +func (r *ReconcileVirtualMachineService) createOrUpdateService(ctx *context.VirtualMachineServiceContext) (*corev1.Service, error) { ctx.Logger.V(5).Info("Reconciling k8s Service") defer ctx.Logger.V(5).Info("Finished reconciling k8s Service") @@ -467,7 +467,7 @@ func (r *ReconcileVirtualMachineService) createOrUpdateService(ctx *context.Virt } func (r *ReconcileVirtualMachineService) getVirtualMachinesSelectedByVMService( - ctx *context.VirtualMachineServiceContextA2) (*vmopv1.VirtualMachineList, error) { + ctx *context.VirtualMachineServiceContext) (*vmopv1.VirtualMachineList, error) { if len(ctx.VMService.Spec.Selector) == 0 { return nil, nil @@ -480,7 +480,7 @@ func (r *ReconcileVirtualMachineService) getVirtualMachinesSelectedByVMService( // getVMsReferencedByServiceEndpoints gets all VMs that are referenced by service endpoints. func (r *ReconcileVirtualMachineService) getVMsReferencedByServiceEndpoints( - ctx *context.VirtualMachineServiceContextA2, + ctx *context.VirtualMachineServiceContext, service *corev1.Service) map[types.UID]struct{} { endpoints := &corev1.Endpoints{} if err := r.Get(ctx, client.ObjectKey{Name: service.Name, Namespace: service.Namespace}, endpoints); err != nil { @@ -531,7 +531,7 @@ func (r *ReconcileVirtualMachineService) getVirtualMachineServicesSelectingVirtu } // createOrUpdateEndpoints updates the Endpoints for VirtualMachineService. -func (r *ReconcileVirtualMachineService) createOrUpdateEndpoints(ctx *context.VirtualMachineServiceContextA2, service *corev1.Service) error { +func (r *ReconcileVirtualMachineService) createOrUpdateEndpoints(ctx *context.VirtualMachineServiceContext, service *corev1.Service) error { ctx.Logger.V(5).Info("Updating VirtualMachineService Endpoints") defer ctx.Logger.V(5).Info("Finished updating VirtualMachineService Endpoints") @@ -593,7 +593,7 @@ func findVMPortNum(_ *vmopv1.VirtualMachine, port intstr.IntOrString, _ corev1.P // generateSubsetsForService generates Endpoints subsets for a given Service. func (r *ReconcileVirtualMachineService) generateSubsetsForService( - ctx *context.VirtualMachineServiceContextA2, + ctx *context.VirtualMachineServiceContext, service *corev1.Service) ([]corev1.EndpointSubset, error) { vmList, err := r.getVirtualMachinesSelectedByVMService(ctx) @@ -701,7 +701,7 @@ func (r *ReconcileVirtualMachineService) generateSubsetsForService( } // updateVMService syncs the VirtualMachineService Status from the Service status. -func (r *ReconcileVirtualMachineService) updateVMService(ctx *context.VirtualMachineServiceContextA2, service *corev1.Service) error { +func (r *ReconcileVirtualMachineService) updateVMService(ctx *context.VirtualMachineServiceContext, service *corev1.Service) error { vmService := ctx.VMService if vmService.Spec.Type == vmopv1.VirtualMachineServiceTypeLoadBalancer { diff --git a/controllers/virtualmachineservice/v1alpha2/virtualmachineservice_controller_intg_test.go b/controllers/virtualmachineservice/virtualmachineservice_controller_intg_test.go similarity index 98% rename from controllers/virtualmachineservice/v1alpha2/virtualmachineservice_controller_intg_test.go rename to controllers/virtualmachineservice/virtualmachineservice_controller_intg_test.go index f3f619ac8..6a67a88ce 100644 --- a/controllers/virtualmachineservice/v1alpha2/virtualmachineservice_controller_intg_test.go +++ b/controllers/virtualmachineservice/virtualmachineservice_controller_intg_test.go @@ -1,7 +1,7 @@ -// Copyright (c) 2019-2020 VMware, Inc. All Rights Reserved. +// Copyright (c) 2019-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachineservice_test import ( . "github.com/onsi/ginkgo/v2" @@ -11,7 +11,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" @@ -28,7 +28,7 @@ func intgTests() { Label( testlabels.Controller, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), intgTestsReconcile, ) diff --git a/controllers/virtualmachineservice/v1alpha2/virtualmachineservice_controller_suite_test.go b/controllers/virtualmachineservice/virtualmachineservice_controller_suite_test.go similarity index 77% rename from controllers/virtualmachineservice/v1alpha2/virtualmachineservice_controller_suite_test.go rename to controllers/virtualmachineservice/virtualmachineservice_controller_suite_test.go index 38d348a96..38f7a16b8 100644 --- a/controllers/virtualmachineservice/v1alpha2/virtualmachineservice_controller_suite_test.go +++ b/controllers/virtualmachineservice/virtualmachineservice_controller_suite_test.go @@ -1,14 +1,14 @@ -// Copyright (c) 2019-2020 VMware, Inc. All Rights Reserved. +// Copyright (c) 2019-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachineservice_test import ( "testing" . "github.com/onsi/ginkgo/v2" - virtualmachineservice "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha2" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/manager" "github.com/vmware-tanzu/vm-operator/test/builder" diff --git a/controllers/virtualmachineservice/v1alpha2/virtualmachineservice_controller_unit_test.go b/controllers/virtualmachineservice/virtualmachineservice_controller_unit_test.go similarity index 98% rename from controllers/virtualmachineservice/v1alpha2/virtualmachineservice_controller_unit_test.go rename to controllers/virtualmachineservice/virtualmachineservice_controller_unit_test.go index af38646f8..9725fdbbd 100644 --- a/controllers/virtualmachineservice/v1alpha2/virtualmachineservice_controller_unit_test.go +++ b/controllers/virtualmachineservice/virtualmachineservice_controller_unit_test.go @@ -1,7 +1,7 @@ -// Copyright (c) 2019-2021 VMware, Inc. All Rights Reserved. +// Copyright (c) 2019-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachineservice_test import ( . "github.com/onsi/ginkgo/v2" @@ -16,11 +16,11 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" - virtualmachineservice "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha2" - "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha2/providers" - "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha2/utils" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/providers" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/utils" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" vmopContext "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -32,7 +32,7 @@ func unitTests() { "Reconcile", Label( testlabels.Controller, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), unitTestsReconcile, ) @@ -41,7 +41,7 @@ func unitTests() { Label( testlabels.Controller, testlabels.NSXT, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), nsxtLBProviderTestsReconcile, ) @@ -55,7 +55,7 @@ func unitTestsReconcile() { ctx *builder.UnitTestContextForController reconciler *virtualmachineservice.ReconcileVirtualMachineService - vmServiceCtx *vmopContext.VirtualMachineServiceContextA2 + vmServiceCtx *vmopContext.VirtualMachineServiceContext vmService *vmopv1.VirtualMachineService vmServicePort1 vmopv1.VirtualMachineServicePort @@ -126,7 +126,7 @@ func unitTestsReconcile() { providers.NoopLoadbalancerProvider{}, ) - vmServiceCtx = &vmopContext.VirtualMachineServiceContextA2{ + vmServiceCtx = &vmopContext.VirtualMachineServiceContext{ Context: ctx, Logger: ctx.Logger.WithName(vmService.Name), VMService: vmService, @@ -804,7 +804,7 @@ func nsxtLBProviderTestsReconcile() { lbProvider providers.LoadbalancerProvider reconciler *virtualmachineservice.ReconcileVirtualMachineService - vmServiceCtx *vmopContext.VirtualMachineServiceContextA2 + vmServiceCtx *vmopContext.VirtualMachineServiceContext vmServicePort1 vmopv1.VirtualMachineServicePort vmService *vmopv1.VirtualMachineService @@ -859,7 +859,7 @@ func nsxtLBProviderTestsReconcile() { lbProvider, ) - vmServiceCtx = &vmopContext.VirtualMachineServiceContextA2{ + vmServiceCtx = &vmopContext.VirtualMachineServiceContext{ Context: ctx, Logger: ctx.Logger.WithName(vmService.Name), VMService: vmService, diff --git a/controllers/virtualmachinesetresourcepolicy/controllers.go b/controllers/virtualmachinesetresourcepolicy/controllers.go deleted file mode 100644 index f729baa6d..000000000 --- a/controllers/virtualmachinesetresourcepolicy/controllers.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package virtualmachinesetresourcepolicy - -import ( - "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesetresourcepolicy/v1alpha2" - "github.com/vmware-tanzu/vm-operator/pkg/context" -) - -// AddToManager adds the controller to the provided manager. -func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) error { - return v1alpha2.AddToManager(ctx, mgr) -} diff --git a/controllers/virtualmachinesetresourcepolicy/v1alpha2/virtualmachinesetresourcepolicy_controller.go b/controllers/virtualmachinesetresourcepolicy/virtualmachinesetresourcepolicy_controller.go similarity index 91% rename from controllers/virtualmachinesetresourcepolicy/v1alpha2/virtualmachinesetresourcepolicy_controller.go rename to controllers/virtualmachinesetresourcepolicy/virtualmachinesetresourcepolicy_controller.go index e9bd1720d..4de201fad 100644 --- a/controllers/virtualmachinesetresourcepolicy/v1alpha2/virtualmachinesetresourcepolicy_controller.go +++ b/controllers/virtualmachinesetresourcepolicy/virtualmachinesetresourcepolicy_controller.go @@ -1,7 +1,7 @@ -// Copyright (c) 2019-2021 VMware, Inc. All Rights Reserved. +// Copyright (c) 2019-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2 +package virtualmachinesetresourcepolicy import ( goctx "context" @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/manager" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/patch" @@ -37,7 +37,7 @@ func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) er ctx, mgr.GetClient(), ctrl.Log.WithName("controllers").WithName(controlledTypeName), - ctx.VMProviderA2, + ctx.VMProvider, ) return ctrl.NewControllerManagedBy(mgr). @@ -49,7 +49,7 @@ func NewReconciler( ctx goctx.Context, client client.Client, logger logr.Logger, - vmProvider vmprovider.VirtualMachineProviderInterfaceA2) *Reconciler { + vmProvider vmprovider.VirtualMachineProviderInterface) *Reconciler { return &Reconciler{ Context: ctx, Client: client, @@ -63,11 +63,11 @@ type Reconciler struct { Context goctx.Context client.Client Logger logr.Logger - VMProvider vmprovider.VirtualMachineProviderInterfaceA2 + VMProvider vmprovider.VirtualMachineProviderInterface } // ReconcileNormal reconciles a VirtualMachineSetResourcePolicy. -func (r *Reconciler) ReconcileNormal(ctx *context.VirtualMachineSetResourcePolicyContextA2) error { +func (r *Reconciler) ReconcileNormal(ctx *context.VirtualMachineSetResourcePolicyContext) error { if !controllerutil.ContainsFinalizer(ctx.ResourcePolicy, finalizerName) { // Return here so the VirtualMachineSetResourcePolicy can be patched immediately. This ensures that // the resource policies are cleaned up properly when they are deleted. @@ -89,7 +89,7 @@ func (r *Reconciler) ReconcileNormal(ctx *context.VirtualMachineSetResourcePolic } // deleteResourcePolicy deletes a VirtualMachineSetResourcePolicy resource. -func (r *Reconciler) deleteResourcePolicy(ctx *context.VirtualMachineSetResourcePolicyContextA2) error { +func (r *Reconciler) deleteResourcePolicy(ctx *context.VirtualMachineSetResourcePolicyContext) error { resourcePolicy := ctx.ResourcePolicy // Skip deleting a VirtualMachineSetResourcePolicy if it is referenced by a VirtualMachine. @@ -116,7 +116,7 @@ func (r *Reconciler) deleteResourcePolicy(ctx *context.VirtualMachineSetResource return nil } -func (r *Reconciler) ReconcileDelete(ctx *context.VirtualMachineSetResourcePolicyContextA2) error { +func (r *Reconciler) ReconcileDelete(ctx *context.VirtualMachineSetResourcePolicyContext) error { ctx.Logger.Info("Reconciling VirtualMachineSetResourcePolicy Deletion") defer func() { ctx.Logger.Info("Finished Reconciling VirtualMachineSetResourcePolicy Deletion") @@ -144,7 +144,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Resu return ctrl.Result{}, client.IgnoreNotFound(err) } - rpCtx := &context.VirtualMachineSetResourcePolicyContextA2{ + rpCtx := &context.VirtualMachineSetResourcePolicyContext{ Context: ctx, Logger: r.Logger.WithName("VirtualMachineSetResourcePolicy").WithValues("name", rp.NamespacedName()), ResourcePolicy: rp, diff --git a/controllers/virtualmachinesetresourcepolicy/v1alpha2/virtualmachinesetresourcepolicy_controller_intg_test.go b/controllers/virtualmachinesetresourcepolicy/virtualmachinesetresourcepolicy_controller_intg_test.go similarity index 93% rename from controllers/virtualmachinesetresourcepolicy/v1alpha2/virtualmachinesetresourcepolicy_controller_intg_test.go rename to controllers/virtualmachinesetresourcepolicy/virtualmachinesetresourcepolicy_controller_intg_test.go index 054370234..bee5bafb8 100644 --- a/controllers/virtualmachinesetresourcepolicy/v1alpha2/virtualmachinesetresourcepolicy_controller_intg_test.go +++ b/controllers/virtualmachinesetresourcepolicy/virtualmachinesetresourcepolicy_controller_intg_test.go @@ -1,7 +1,7 @@ -// Copyright (c) 2019-2020 VMware, Inc. All Rights Reserved. +// Copyright (c) 2019-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachinesetresourcepolicy_test import ( "context" @@ -13,7 +13,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -25,7 +25,7 @@ func intgTests() { Label( testlabels.Controller, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), intgTestsReconcile, ) diff --git a/controllers/virtualmachinesetresourcepolicy/v1alpha2/virtualmachinesetresourcepolicy_controller_suite_test.go b/controllers/virtualmachinesetresourcepolicy/virtualmachinesetresourcepolicy_controller_suite_test.go similarity index 74% rename from controllers/virtualmachinesetresourcepolicy/v1alpha2/virtualmachinesetresourcepolicy_controller_suite_test.go rename to controllers/virtualmachinesetresourcepolicy/virtualmachinesetresourcepolicy_controller_suite_test.go index f502f162e..32372de2a 100644 --- a/controllers/virtualmachinesetresourcepolicy/v1alpha2/virtualmachinesetresourcepolicy_controller_suite_test.go +++ b/controllers/virtualmachinesetresourcepolicy/virtualmachinesetresourcepolicy_controller_suite_test.go @@ -1,7 +1,7 @@ -// Copyright (c) 2020 VMware, Inc. All Rights Reserved. +// Copyright (c) 2020-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachinesetresourcepolicy_test import ( "testing" @@ -10,20 +10,20 @@ import ( ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" - virtualmachinesetresourcepolicy "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesetresourcepolicy/v1alpha2" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesetresourcepolicy" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" ctrlContext "github.com/vmware-tanzu/vm-operator/pkg/context" providerfake "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/fake" "github.com/vmware-tanzu/vm-operator/test/builder" ) -var intgFakeVMProvider = providerfake.NewVMProviderA2() +var intgFakeVMProvider = providerfake.NewVMProvider() var suite = builder.NewTestSuiteForControllerWithContext( pkgconfig.NewContextWithDefaultConfig(), virtualmachinesetresourcepolicy.AddToManager, func(ctx *ctrlContext.ControllerManagerContext, _ ctrlmgr.Manager) error { - ctx.VMProviderA2 = intgFakeVMProvider + ctx.VMProvider = intgFakeVMProvider return nil }) diff --git a/controllers/virtualmachinesetresourcepolicy/v1alpha2/virtualmachinesetresourcepolicy_controller_unit_test.go b/controllers/virtualmachinesetresourcepolicy/virtualmachinesetresourcepolicy_controller_unit_test.go similarity index 92% rename from controllers/virtualmachinesetresourcepolicy/v1alpha2/virtualmachinesetresourcepolicy_controller_unit_test.go rename to controllers/virtualmachinesetresourcepolicy/virtualmachinesetresourcepolicy_controller_unit_test.go index dad14ac3a..66c91e19e 100644 --- a/controllers/virtualmachinesetresourcepolicy/v1alpha2/virtualmachinesetresourcepolicy_controller_unit_test.go +++ b/controllers/virtualmachinesetresourcepolicy/virtualmachinesetresourcepolicy_controller_unit_test.go @@ -1,7 +1,7 @@ -// Copyright (c) 2020-2021 VMware, Inc. All Rights Reserved. +// Copyright (c) 2020-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package virtualmachinesetresourcepolicy_test import ( "fmt" @@ -13,9 +13,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" - virtualmachinesetresourcepolicy "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesetresourcepolicy/v1alpha2" + "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesetresourcepolicy" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -30,7 +30,7 @@ func unitTests() { "Reconcile", Label( testlabels.Controller, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), unitTestsReconcile, ) @@ -42,7 +42,7 @@ func unitTestsReconcile() { ctx *builder.UnitTestContextForController reconciler *virtualmachinesetresourcepolicy.Reconciler - resourcePolicyCtx *context.VirtualMachineSetResourcePolicyContextA2 + resourcePolicyCtx *context.VirtualMachineSetResourcePolicyContext resourcePolicy *vmopv1.VirtualMachineSetResourcePolicy vm, vmNoReserved *vmopv1.VirtualMachine ) @@ -80,10 +80,10 @@ func unitTestsReconcile() { reconciler = &virtualmachinesetresourcepolicy.Reconciler{ Client: ctx.Client, Logger: ctx.Logger, - VMProvider: ctx.VMProviderA2, + VMProvider: ctx.VMProvider, } - resourcePolicyCtx = &context.VirtualMachineSetResourcePolicyContextA2{ + resourcePolicyCtx = &context.VirtualMachineSetResourcePolicyContext{ Context: ctx.Context, Logger: ctx.Logger.WithName(resourcePolicy.Namespace).WithName(resourcePolicy.Name), ResourcePolicy: resourcePolicy, diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/getter.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/getter.go index 4bf0c8771..ca59123d3 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/getter.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/getter.go @@ -21,7 +21,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) // Getter interface defines methods that a Cluster API object should implement in order to @@ -30,12 +30,12 @@ type Getter interface { client.Object // GetConditions returns the list of conditions for a cluster API object. - GetConditions() vmopv1.Conditions + GetConditions() vmopv1a1.Conditions } // Get returns the condition with the given type, if the condition does not exists, // it returns nil. -func Get(from Getter, t vmopv1.ConditionType) *vmopv1.Condition { +func Get(from Getter, t vmopv1a1.ConditionType) *vmopv1a1.Condition { conditions := from.GetConditions() if conditions == nil { return nil @@ -50,18 +50,18 @@ func Get(from Getter, t vmopv1.ConditionType) *vmopv1.Condition { } // Has returns true if a condition with the given type exists. -func Has(from Getter, t vmopv1.ConditionType) bool { +func Has(from Getter, t vmopv1a1.ConditionType) bool { return Get(from, t) != nil } // IsTrueFromConditions returns true if the condition with the given type is True. // This is helpful to check the condition without passing a specific resource object. -func IsTrueFromConditions(conditions vmopv1.Conditions, t vmopv1.ConditionType) bool { +func IsTrueFromConditions(conditions vmopv1a1.Conditions, t vmopv1a1.ConditionType) bool { if conditions == nil { return false } - var c vmopv1.Condition + var c vmopv1a1.Condition for _, condition := range conditions { if condition.Type == t { c = condition @@ -72,7 +72,7 @@ func IsTrueFromConditions(conditions vmopv1.Conditions, t vmopv1.ConditionType) // IsTrue is true if the condition with the given type is True, otherwise it return false // if the condition is not True or if the condition does not exist (is nil). -func IsTrue(from Getter, t vmopv1.ConditionType) bool { +func IsTrue(from Getter, t vmopv1a1.ConditionType) bool { if c := Get(from, t); c != nil { return c.Status == corev1.ConditionTrue } @@ -81,7 +81,7 @@ func IsTrue(from Getter, t vmopv1.ConditionType) bool { // IsFalse is true if the condition with the given type is False, otherwise it return false // if the condition is not False or if the condition does not exist (is nil). -func IsFalse(from Getter, t vmopv1.ConditionType) bool { +func IsFalse(from Getter, t vmopv1a1.ConditionType) bool { if c := Get(from, t); c != nil { return c.Status == corev1.ConditionFalse } @@ -90,7 +90,7 @@ func IsFalse(from Getter, t vmopv1.ConditionType) bool { // IsUnknown is true if the condition with the given type is Unknown or if the condition // does not exist (is nil). -func IsUnknown(from Getter, t vmopv1.ConditionType) bool { +func IsUnknown(from Getter, t vmopv1a1.ConditionType) bool { if c := Get(from, t); c != nil { return c.Status == corev1.ConditionUnknown } @@ -98,7 +98,7 @@ func IsUnknown(from Getter, t vmopv1.ConditionType) bool { } // GetReason returns a nil safe string of Reason for the condition with the given type. -func GetReason(from Getter, t vmopv1.ConditionType) string { +func GetReason(from Getter, t vmopv1a1.ConditionType) string { if c := Get(from, t); c != nil { return c.Reason } @@ -106,7 +106,7 @@ func GetReason(from Getter, t vmopv1.ConditionType) string { } // GetMessage returns a nil safe string of Message. -func GetMessage(from Getter, t vmopv1.ConditionType) string { +func GetMessage(from Getter, t vmopv1a1.ConditionType) string { if c := Get(from, t); c != nil { return c.Message } @@ -115,7 +115,7 @@ func GetMessage(from Getter, t vmopv1.ConditionType) string { // GetSeverity returns the condition Severity or nil if the condition // does not exist (is nil). -func GetSeverity(from Getter, t vmopv1.ConditionType) *vmopv1.ConditionSeverity { +func GetSeverity(from Getter, t vmopv1a1.ConditionType) *vmopv1a1.ConditionSeverity { if c := Get(from, t); c != nil { return &c.Severity } @@ -124,7 +124,7 @@ func GetSeverity(from Getter, t vmopv1.ConditionType) *vmopv1.ConditionSeverity // GetLastTransitionTime returns the condition Severity or nil if the condition // does not exist (is nil). -func GetLastTransitionTime(from Getter, t vmopv1.ConditionType) *metav1.Time { +func GetLastTransitionTime(from Getter, t vmopv1a1.ConditionType) *metav1.Time { if c := Get(from, t); c != nil { return &c.LastTransitionTime } @@ -133,7 +133,7 @@ func GetLastTransitionTime(from Getter, t vmopv1.ConditionType) *metav1.Time { // summary returns a Ready condition with the summary of all the conditions existing // on an object. If the object does not have other conditions, no summary condition is generated. -func summary(from Getter, options ...MergeOption) *vmopv1.Condition { +func summary(from Getter, options ...MergeOption) *vmopv1a1.Condition { conditions := from.GetConditions() mergeOpt := &mergeOptions{} @@ -146,7 +146,7 @@ func summary(from Getter, options ...MergeOption) *vmopv1.Condition { conditionsInScope := make([]localizedCondition, 0, len(conditions)) for i := range conditions { c := conditions[i] - if c.Type == vmopv1.ReadyCondition { + if c.Type == vmopv1a1.ReadyCondition { continue } @@ -199,14 +199,14 @@ func summary(from Getter, options ...MergeOption) *vmopv1.Condition { } } - return merge(conditionsInScope, vmopv1.ReadyCondition, mergeOpt) + return merge(conditionsInScope, vmopv1a1.ReadyCondition, mergeOpt) } // mirrorOptions allows to set options for the mirror operation. type mirrorOptions struct { fallbackTo *bool fallbackReason string - fallbackSeverity vmopv1.ConditionSeverity + fallbackSeverity vmopv1a1.ConditionSeverity fallbackMessage string } @@ -215,7 +215,7 @@ type MirrorOptions func(*mirrorOptions) // WithFallbackValue specify a fallback value to use in case the mirrored condition does not exists; // in case the fallbackValue is false, given values for reason, severity and message will be used. -func WithFallbackValue(fallbackValue bool, reason string, severity vmopv1.ConditionSeverity, message string) MirrorOptions { +func WithFallbackValue(fallbackValue bool, reason string, severity vmopv1a1.ConditionSeverity, message string) MirrorOptions { return func(c *mirrorOptions) { c.fallbackTo = &fallbackValue c.fallbackReason = reason @@ -226,13 +226,13 @@ func WithFallbackValue(fallbackValue bool, reason string, severity vmopv1.Condit // mirror mirrors the Ready condition from a dependent object into the target condition; // if the Ready condition does not exists in the source object, no target conditions is generated. -func mirror(from Getter, targetCondition vmopv1.ConditionType, options ...MirrorOptions) *vmopv1.Condition { +func mirror(from Getter, targetCondition vmopv1a1.ConditionType, options ...MirrorOptions) *vmopv1a1.Condition { mirrorOpt := &mirrorOptions{} for _, o := range options { o(mirrorOpt) } - condition := Get(from, vmopv1.ReadyCondition) + condition := Get(from, vmopv1a1.ReadyCondition) if mirrorOpt.fallbackTo != nil && condition == nil { switch *mirrorOpt.fallbackTo { @@ -253,10 +253,10 @@ func mirror(from Getter, targetCondition vmopv1.ConditionType, options ...Mirror // Aggregates all the the Ready condition from a list of dependent objects into the target object; // if the Ready condition does not exists in one of the source object, the object is excluded from // the aggregation; if none of the source object have ready condition, no target conditions is generated. -func aggregate(from []Getter, targetCondition vmopv1.ConditionType, options ...MergeOption) *vmopv1.Condition { +func aggregate(from []Getter, targetCondition vmopv1a1.ConditionType, options ...MergeOption) *vmopv1a1.Condition { conditionsInScope := make([]localizedCondition, 0, len(from)) for i := range from { - condition := Get(from[i], vmopv1.ReadyCondition) + condition := Get(from[i], vmopv1a1.ReadyCondition) conditionsInScope = append(conditionsInScope, localizedCondition{ Condition: condition, diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/getter_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/getter_test.go index bb769afce..b9e83aa57 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/getter_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/getter_test.go @@ -25,22 +25,22 @@ import ( "github.com/onsi/gomega/types" "github.com/pkg/errors" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) var ( - nil1 *vmopv1.Condition + nil1 *vmopv1a1.Condition true1 = TrueCondition("true1") unknown1 = UnknownCondition("unknown1", "reason unknown1", "message unknown1") - falseInfo1 = FalseCondition("falseInfo1", "reason falseInfo1", vmopv1.ConditionSeverityInfo, "message falseInfo1") - falseWarning1 = FalseCondition("falseWarning1", "reason falseWarning1", vmopv1.ConditionSeverityWarning, "message falseWarning1") - falseError1 = FalseCondition("falseError1", "reason falseError1", vmopv1.ConditionSeverityError, "message falseError1") + falseInfo1 = FalseCondition("falseInfo1", "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "message falseInfo1") + falseWarning1 = FalseCondition("falseWarning1", "reason falseWarning1", vmopv1a1.ConditionSeverityWarning, "message falseWarning1") + falseError1 = FalseCondition("falseError1", "reason falseError1", vmopv1a1.ConditionSeverityError, "message falseError1") ) func TestGetAndHas(t *testing.T) { g := NewWithT(t) - vm := &vmopv1.VirtualMachine{} + vm := &vmopv1a1.VirtualMachine{} g.Expect(Has(vm, "conditionBaz")).To(BeFalse()) g.Expect(Get(vm, "conditionBaz")).To(BeNil()) @@ -85,7 +85,7 @@ func TestIsMethods(t *testing.T) { // test GetSeverity g.Expect(GetSeverity(obj, "nil1")).To(BeNil()) severity := GetSeverity(obj, "falseInfo1") - expectedSeverity := vmopv1.ConditionSeverityInfo + expectedSeverity := vmopv1a1.ConditionSeverityInfo g.Expect(severity).To(Equal(&expectedSeverity)) // test GetMessage @@ -94,16 +94,16 @@ func TestIsMethods(t *testing.T) { } func TestMirror(t *testing.T) { - foo := FalseCondition("foo", "reason foo", vmopv1.ConditionSeverityInfo, "message foo") - ready := TrueCondition(vmopv1.ReadyCondition) + foo := FalseCondition("foo", "reason foo", vmopv1a1.ConditionSeverityInfo, "message foo") + ready := TrueCondition(vmopv1a1.ReadyCondition) readyBar := ready.DeepCopy() readyBar.Type = "bar" tests := []struct { name string from Getter - t vmopv1.ConditionType - want *vmopv1.Condition + t vmopv1a1.ConditionType + want *vmopv1a1.Condition }{ { name: "Returns nil when the ready condition does not exists", @@ -134,15 +134,15 @@ func TestMirror(t *testing.T) { func TestSummary(t *testing.T) { foo := TrueCondition("foo") - bar := FalseCondition("bar", "reason falseInfo1", vmopv1.ConditionSeverityInfo, "message falseInfo1") - baz := FalseCondition("baz", "reason falseInfo2", vmopv1.ConditionSeverityInfo, "message falseInfo2") - existingReady := FalseCondition(vmopv1.ReadyCondition, "reason falseError1", vmopv1.ConditionSeverityError, "message falseError1") // NB. existing ready has higher priority than other conditions + bar := FalseCondition("bar", "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "message falseInfo1") + baz := FalseCondition("baz", "reason falseInfo2", vmopv1a1.ConditionSeverityInfo, "message falseInfo2") + existingReady := FalseCondition(vmopv1a1.ReadyCondition, "reason falseError1", vmopv1a1.ConditionSeverityError, "message falseError1") // NB. existing ready has higher priority than other conditions tests := []struct { name string from Getter options []MergeOption - want *vmopv1.Condition + want *vmopv1a1.Condition }{ { name: "Returns nil when there are no conditions to summarize", @@ -152,78 +152,78 @@ func TestSummary(t *testing.T) { { name: "Returns ready condition with the summary of existing conditions (with default options)", from: getterWithConditions(foo, bar), - want: FalseCondition(vmopv1.ReadyCondition, "reason falseInfo1", vmopv1.ConditionSeverityInfo, "message falseInfo1"), + want: FalseCondition(vmopv1a1.ReadyCondition, "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "message falseInfo1"), }, { name: "Returns ready condition with the summary of existing conditions (using WithStepCounter options)", from: getterWithConditions(foo, bar), options: []MergeOption{WithStepCounter()}, - want: FalseCondition(vmopv1.ReadyCondition, "reason falseInfo1", vmopv1.ConditionSeverityInfo, "1 of 2 completed"), + want: FalseCondition(vmopv1a1.ReadyCondition, "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "1 of 2 completed"), }, { name: "Returns ready condition with the summary of existing conditions (using WithStepCounterIf options)", from: getterWithConditions(foo, bar), options: []MergeOption{WithStepCounterIf(false)}, - want: FalseCondition(vmopv1.ReadyCondition, "reason falseInfo1", vmopv1.ConditionSeverityInfo, "message falseInfo1"), + want: FalseCondition(vmopv1a1.ReadyCondition, "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "message falseInfo1"), }, { name: "Returns ready condition with the summary of existing conditions (using WithStepCounterIf options)", from: getterWithConditions(foo, bar), options: []MergeOption{WithStepCounterIf(true)}, - want: FalseCondition(vmopv1.ReadyCondition, "reason falseInfo1", vmopv1.ConditionSeverityInfo, "1 of 2 completed"), + want: FalseCondition(vmopv1a1.ReadyCondition, "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "1 of 2 completed"), }, { name: "Returns ready condition with the summary of existing conditions (using WithStepCounterIf and WithStepCounterIfOnly options)", from: getterWithConditions(bar), options: []MergeOption{WithStepCounter(), WithStepCounterIfOnly("bar")}, - want: FalseCondition(vmopv1.ReadyCondition, "reason falseInfo1", vmopv1.ConditionSeverityInfo, "0 of 1 completed"), + want: FalseCondition(vmopv1a1.ReadyCondition, "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "0 of 1 completed"), }, { name: "Returns ready condition with the summary of existing conditions (using WithStepCounterIf and WithStepCounterIfOnly options)", from: getterWithConditions(foo, bar), options: []MergeOption{WithStepCounter(), WithStepCounterIfOnly("foo")}, - want: FalseCondition(vmopv1.ReadyCondition, "reason falseInfo1", vmopv1.ConditionSeverityInfo, "message falseInfo1"), + want: FalseCondition(vmopv1a1.ReadyCondition, "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "message falseInfo1"), }, { name: "Returns ready condition with the summary of selected conditions (using WithConditions options)", from: getterWithConditions(foo, bar), options: []MergeOption{WithConditions("foo")}, // bar should be ignored - want: TrueCondition(vmopv1.ReadyCondition), + want: TrueCondition(vmopv1a1.ReadyCondition), }, { name: "Returns ready condition with the summary of selected conditions (using WithConditions and WithStepCounter options)", from: getterWithConditions(foo, bar, baz), options: []MergeOption{WithConditions("foo", "bar"), WithStepCounter()}, // baz should be ignored, total steps should be 2 - want: FalseCondition(vmopv1.ReadyCondition, "reason falseInfo1", vmopv1.ConditionSeverityInfo, "1 of 2 completed"), + want: FalseCondition(vmopv1a1.ReadyCondition, "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "1 of 2 completed"), }, { name: "Returns ready condition with the summary of selected conditions (using WithConditions and WithStepCounterIfOnly options)", from: getterWithConditions(bar), options: []MergeOption{WithConditions("bar", "baz"), WithStepCounter(), WithStepCounterIfOnly("bar")}, // there is only bar, the step counter should be set and counts only a subset of conditions - want: FalseCondition(vmopv1.ReadyCondition, "reason falseInfo1", vmopv1.ConditionSeverityInfo, "0 of 1 completed"), + want: FalseCondition(vmopv1a1.ReadyCondition, "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "0 of 1 completed"), }, { name: "Returns ready condition with the summary of selected conditions (using WithConditions and WithStepCounterIfOnly options - with inconsistent order between the two)", from: getterWithConditions(bar), options: []MergeOption{WithConditions("baz", "bar"), WithStepCounter(), WithStepCounterIfOnly("bar", "baz")}, // conditions in WithStepCounterIfOnly could be in different order than in WithConditions - want: FalseCondition(vmopv1.ReadyCondition, "reason falseInfo1", vmopv1.ConditionSeverityInfo, "0 of 2 completed"), + want: FalseCondition(vmopv1a1.ReadyCondition, "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "0 of 2 completed"), }, { name: "Returns ready condition with the summary of selected conditions (using WithConditions and WithStepCounterIfOnly options)", from: getterWithConditions(bar, baz), options: []MergeOption{WithConditions("bar", "baz"), WithStepCounter(), WithStepCounterIfOnly("bar")}, // there is also baz, so the step counter should not be set - want: FalseCondition(vmopv1.ReadyCondition, "reason falseInfo1", vmopv1.ConditionSeverityInfo, "message falseInfo1"), + want: FalseCondition(vmopv1a1.ReadyCondition, "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "message falseInfo1"), }, { name: "Ready condition respects merge order", from: getterWithConditions(bar, baz), options: []MergeOption{WithConditions("baz", "bar")}, // baz should take precedence on bar - want: FalseCondition(vmopv1.ReadyCondition, "reason falseInfo2", vmopv1.ConditionSeverityInfo, "message falseInfo2"), + want: FalseCondition(vmopv1a1.ReadyCondition, "reason falseInfo2", vmopv1a1.ConditionSeverityInfo, "message falseInfo2"), }, { name: "Ignores existing Ready condition when computing the summary", from: getterWithConditions(existingReady, foo, bar), - want: FalseCondition(vmopv1.ReadyCondition, "reason falseInfo1", vmopv1.ConditionSeverityInfo, "message falseInfo1"), + want: FalseCondition(vmopv1a1.ReadyCondition, "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "message falseInfo1"), }, } @@ -242,15 +242,15 @@ func TestSummary(t *testing.T) { } func TestAggregate(t *testing.T) { - ready1 := TrueCondition(vmopv1.ReadyCondition) - ready2 := FalseCondition(vmopv1.ReadyCondition, "reason falseInfo1", vmopv1.ConditionSeverityInfo, "message falseInfo1") - bar := FalseCondition("bar", "reason falseError1", vmopv1.ConditionSeverityError, "message falseError1") // NB. bar has higher priority than other conditions + ready1 := TrueCondition(vmopv1a1.ReadyCondition) + ready2 := FalseCondition(vmopv1a1.ReadyCondition, "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "message falseInfo1") + bar := FalseCondition("bar", "reason falseError1", vmopv1a1.ConditionSeverityError, "message falseError1") // NB. bar has higher priority than other conditions tests := []struct { name string from []Getter - t vmopv1.ConditionType - want *vmopv1.Condition + t vmopv1a1.ConditionType + want *vmopv1a1.Condition }{ { name: "Returns nil when there are no conditions to aggregate", @@ -267,7 +267,7 @@ func TestAggregate(t *testing.T) { getterWithConditions(bar), }, t: "foo", - want: FalseCondition("foo", "reason falseInfo1", vmopv1.ConditionSeverityInfo, "2 of 5 completed"), + want: FalseCondition("foo", "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "2 of 5 completed"), }, } @@ -285,14 +285,14 @@ func TestAggregate(t *testing.T) { } } -func getterWithConditions(conditions ...*vmopv1.Condition) Getter { - obj := &vmopv1.VirtualMachine{} +func getterWithConditions(conditions ...*vmopv1a1.Condition) Getter { + obj := &vmopv1a1.VirtualMachine{} obj.SetConditions(conditionList(conditions...)) return obj } -func conditionList(conditions ...*vmopv1.Condition) vmopv1.Conditions { - cs := vmopv1.Conditions{} +func conditionList(conditions ...*vmopv1a1.Condition) vmopv1a1.Conditions { + cs := vmopv1a1.Conditions{} for _, x := range conditions { if x != nil { cs = append(cs, *x) @@ -301,18 +301,18 @@ func conditionList(conditions ...*vmopv1.Condition) vmopv1.Conditions { return cs } -func haveSameStateOf(expected *vmopv1.Condition) types.GomegaMatcher { +func haveSameStateOf(expected *vmopv1a1.Condition) types.GomegaMatcher { return &ConditionMatcher{ Expected: expected, } } type ConditionMatcher struct { - Expected *vmopv1.Condition + Expected *vmopv1a1.Condition } func (matcher *ConditionMatcher) Match(actual interface{}) (success bool, err error) { - actualCondition, ok := actual.(*vmopv1.Condition) + actualCondition, ok := actual.(*vmopv1a1.Condition) if !ok { return false, errors.New("Value should be a condition") } diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/matcher.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/matcher.go index 80758f370..22e7a2a8f 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/matcher.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/matcher.go @@ -22,18 +22,18 @@ import ( "github.com/onsi/gomega" "github.com/onsi/gomega/types" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) // MatchConditions returns a custom matcher to check equality of vmopv1.Conditions. -func MatchConditions(expected vmopv1.Conditions) types.GomegaMatcher { +func MatchConditions(expected vmopv1a1.Conditions) types.GomegaMatcher { return &matchConditions{ expected: expected, } } type matchConditions struct { - expected vmopv1.Conditions + expected vmopv1a1.Conditions } func (m matchConditions) Match(actual interface{}) (success bool, err error) { @@ -54,18 +54,18 @@ func (m matchConditions) NegatedFailureMessage(actual interface{}) (message stri } // MatchCondition returns a custom matcher to check equality of vmopv1.Condition. -func MatchCondition(expected vmopv1.Condition) types.GomegaMatcher { +func MatchCondition(expected vmopv1a1.Condition) types.GomegaMatcher { return &matchCondition{ expected: expected, } } type matchCondition struct { - expected vmopv1.Condition + expected vmopv1a1.Condition } func (m matchCondition) Match(actual interface{}) (success bool, err error) { - actualCondition, ok := actual.(vmopv1.Condition) + actualCondition, ok := actual.(vmopv1a1.Condition) if !ok { return false, fmt.Errorf("actual should be of type Condition") } diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/matcher_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/matcher_test.go index 5a4496701..871248532 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/matcher_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/matcher_test.go @@ -24,39 +24,39 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) func TestMatchConditions(t *testing.T) { testCases := []struct { name string actual interface{} - expected vmopv1.Conditions + expected vmopv1a1.Conditions expectMatch bool }{ { name: "with an empty conditions", - actual: vmopv1.Conditions{}, - expected: vmopv1.Conditions{}, + actual: vmopv1a1.Conditions{}, + expected: vmopv1a1.Conditions{}, expectMatch: true, }, { name: "with matching conditions", - actual: vmopv1.Conditions{ + actual: vmopv1a1.Conditions{ { - Type: vmopv1.ConditionType("type"), + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", }, }, - expected: vmopv1.Conditions{ + expected: vmopv1a1.Conditions{ { - Type: vmopv1.ConditionType("type"), + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", @@ -66,37 +66,37 @@ func TestMatchConditions(t *testing.T) { }, { name: "with non-matching conditions", - actual: vmopv1.Conditions{ + actual: vmopv1a1.Conditions{ { - Type: vmopv1.ConditionType("type"), + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", }, { - Type: vmopv1.ConditionType("type"), + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", }, }, - expected: vmopv1.Conditions{ + expected: vmopv1a1.Conditions{ { - Type: vmopv1.ConditionType("type"), + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", }, { - Type: vmopv1.ConditionType("different"), + Type: vmopv1a1.ConditionType("different"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "different", Message: "different", @@ -106,29 +106,29 @@ func TestMatchConditions(t *testing.T) { }, { name: "with a different number of conditions", - actual: vmopv1.Conditions{ + actual: vmopv1a1.Conditions{ { - Type: vmopv1.ConditionType("type"), + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", }, { - Type: vmopv1.ConditionType("type"), + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", }, }, - expected: vmopv1.Conditions{ + expected: vmopv1a1.Conditions{ { - Type: vmopv1.ConditionType("type"), + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", @@ -154,29 +154,29 @@ func TestMatchCondition(t *testing.T) { testCases := []struct { name string actual interface{} - expected vmopv1.Condition + expected vmopv1a1.Condition expectMatch bool }{ { name: "with an empty condition", - actual: vmopv1.Condition{}, - expected: vmopv1.Condition{}, + actual: vmopv1a1.Condition{}, + expected: vmopv1a1.Condition{}, expectMatch: true, }, { name: "with a matching condition", - actual: vmopv1.Condition{ - Type: vmopv1.ConditionType("type"), + actual: vmopv1a1.Condition{ + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", }, - expected: vmopv1.Condition{ - Type: vmopv1.ConditionType("type"), + expected: vmopv1a1.Condition{ + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", @@ -185,18 +185,18 @@ func TestMatchCondition(t *testing.T) { }, { name: "with a different time", - actual: vmopv1.Condition{ - Type: vmopv1.ConditionType("type"), + actual: vmopv1a1.Condition{ + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", }, - expected: vmopv1.Condition{ - Type: vmopv1.ConditionType("type"), + expected: vmopv1a1.Condition{ + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Time{}, Reason: "reason", Message: "message", @@ -205,18 +205,18 @@ func TestMatchCondition(t *testing.T) { }, { name: "with a different type", - actual: vmopv1.Condition{ - Type: vmopv1.ConditionType("type"), + actual: vmopv1a1.Condition{ + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", }, - expected: vmopv1.Condition{ - Type: vmopv1.ConditionType("different"), + expected: vmopv1a1.Condition{ + Type: vmopv1a1.ConditionType("different"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", @@ -225,18 +225,18 @@ func TestMatchCondition(t *testing.T) { }, { name: "with a different status", - actual: vmopv1.Condition{ - Type: vmopv1.ConditionType("type"), + actual: vmopv1a1.Condition{ + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", }, - expected: vmopv1.Condition{ - Type: vmopv1.ConditionType("type"), + expected: vmopv1a1.Condition{ + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionFalse, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", @@ -245,18 +245,18 @@ func TestMatchCondition(t *testing.T) { }, { name: "with a different severity", - actual: vmopv1.Condition{ - Type: vmopv1.ConditionType("type"), + actual: vmopv1a1.Condition{ + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", }, - expected: vmopv1.Condition{ - Type: vmopv1.ConditionType("type"), + expected: vmopv1a1.Condition{ + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityInfo, + Severity: vmopv1a1.ConditionSeverityInfo, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", @@ -265,18 +265,18 @@ func TestMatchCondition(t *testing.T) { }, { name: "with a different reason", - actual: vmopv1.Condition{ - Type: vmopv1.ConditionType("type"), + actual: vmopv1a1.Condition{ + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", }, - expected: vmopv1.Condition{ - Type: vmopv1.ConditionType("type"), + expected: vmopv1a1.Condition{ + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "different", Message: "message", @@ -285,18 +285,18 @@ func TestMatchCondition(t *testing.T) { }, { name: "with a different message", - actual: vmopv1.Condition{ - Type: vmopv1.ConditionType("type"), + actual: vmopv1a1.Condition{ + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "message", }, - expected: vmopv1.Condition{ - Type: vmopv1.ConditionType("type"), + expected: vmopv1a1.Condition{ + Type: vmopv1a1.ConditionType("type"), Status: corev1.ConditionTrue, - Severity: vmopv1.ConditionSeverityNone, + Severity: vmopv1a1.ConditionSeverityNone, LastTransitionTime: metav1.Now(), Reason: "reason", Message: "different", diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge.go index 07ddd8ff6..5d950c9c3 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge.go @@ -21,13 +21,13 @@ import ( corev1 "k8s.io/api/core/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) // localizedCondition defines a condition with the information of the object the conditions // was originated from. type localizedCondition struct { - *vmopv1.Condition + *vmopv1a1.Condition Getter } @@ -51,7 +51,7 @@ type localizedCondition struct { // condition; in order to complete such task some trade-off should be made, because there is no a golden rule // for summarizing many Reason/Message into single Reason/Message. // mergeOptions allows the user to adapt this process to the specific needs by exposing a set of merge strategies. -func merge(conditions []localizedCondition, targetCondition vmopv1.ConditionType, options *mergeOptions) *vmopv1.Condition { +func merge(conditions []localizedCondition, targetCondition vmopv1a1.ConditionType, options *mergeOptions) *vmopv1a1.Condition { g := getConditionGroups(conditions) if len(g) == 0 { return nil @@ -142,20 +142,20 @@ func (g conditionGroups) TopGroup() *conditionGroup { // TrueGroup returns the the condition group with status True, if any. func (g conditionGroups) TrueGroup() *conditionGroup { - return g.getByStatusAndSeverity(corev1.ConditionTrue, vmopv1.ConditionSeverityNone) + return g.getByStatusAndSeverity(corev1.ConditionTrue, vmopv1a1.ConditionSeverityNone) } // ErrorGroup returns the the condition group with status False and severity Error, if any. func (g conditionGroups) ErrorGroup() *conditionGroup { - return g.getByStatusAndSeverity(corev1.ConditionFalse, vmopv1.ConditionSeverityError) + return g.getByStatusAndSeverity(corev1.ConditionFalse, vmopv1a1.ConditionSeverityError) } // WarningGroup returns the the condition group with status False and severity Warning, if any. func (g conditionGroups) WarningGroup() *conditionGroup { - return g.getByStatusAndSeverity(corev1.ConditionFalse, vmopv1.ConditionSeverityWarning) + return g.getByStatusAndSeverity(corev1.ConditionFalse, vmopv1a1.ConditionSeverityWarning) } -func (g conditionGroups) getByStatusAndSeverity(status corev1.ConditionStatus, severity vmopv1.ConditionSeverity) *conditionGroup { +func (g conditionGroups) getByStatusAndSeverity(status corev1.ConditionStatus, severity vmopv1a1.ConditionSeverity) *conditionGroup { if len(g) == 0 { return nil } @@ -171,7 +171,7 @@ func (g conditionGroups) getByStatusAndSeverity(status corev1.ConditionStatus, s // and thus with the same priority when merging into a Ready condition. type conditionGroup struct { status corev1.ConditionStatus - severity vmopv1.ConditionSeverity + severity vmopv1a1.ConditionSeverity conditions []localizedCondition } @@ -181,11 +181,11 @@ func (g conditionGroup) mergePriority() int { switch g.status { case corev1.ConditionFalse: switch g.severity { - case vmopv1.ConditionSeverityError: + case vmopv1a1.ConditionSeverityError: return 0 - case vmopv1.ConditionSeverityWarning: + case vmopv1a1.ConditionSeverityWarning: return 1 - case vmopv1.ConditionSeverityInfo: + case vmopv1a1.ConditionSeverityInfo: return 2 } case corev1.ConditionTrue: diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge_strategies.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge_strategies.go index d6e85d92c..cbea766ee 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge_strategies.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge_strategies.go @@ -20,16 +20,16 @@ import ( "fmt" "strings" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) // mergeOptions allows to set strategies for merging a set of conditions into a single condition, // and more specifically for computing the target Reason and the target Message. type mergeOptions struct { - conditionTypes []vmopv1.ConditionType + conditionTypes []vmopv1a1.ConditionType addSourceRef bool addStepCounter bool - addStepCounterIfOnlyConditionTypes []vmopv1.ConditionType + addStepCounterIfOnlyConditionTypes []vmopv1a1.ConditionType stepCounter int } @@ -44,7 +44,7 @@ type MergeOption func(*mergeOptions) // NOTE: The order of conditions types defines the priority for determining the Reason and Message for the // target condition. // IMPORTANT: This options works only while generating the Summary condition. -func WithConditions(t ...vmopv1.ConditionType) MergeOption { +func WithConditions(t ...vmopv1a1.ConditionType) MergeOption { return func(c *mergeOptions) { c.conditionTypes = t } @@ -75,7 +75,7 @@ func WithStepCounterIf(value bool) MergeOption { // // IMPORTANT: This options requires WithStepCounter or WithStepCounterIf to be set. // IMPORTANT: This options works only while generating the Summary condition. -func WithStepCounterIfOnly(t ...vmopv1.ConditionType) MergeOption { +func WithStepCounterIfOnly(t ...vmopv1a1.ConditionType) MergeOption { return func(c *mergeOptions) { c.addStepCounterIfOnlyConditionTypes = t } @@ -96,7 +96,7 @@ func getReason(groups conditionGroups, options *mergeOptions) string { // getFirstReason returns the first reason from the ordered list of conditions in the top group. // If required, the reason gets localized with the source object reference. -func getFirstReason(g conditionGroups, order []vmopv1.ConditionType, addSourceRef bool) string { +func getFirstReason(g conditionGroups, order []vmopv1a1.ConditionType, addSourceRef bool) string { if condition := getFirstCondition(g, order); condition != nil { reason := condition.Reason if addSourceRef { @@ -137,7 +137,7 @@ func getStepCounterMessage(groups conditionGroups, to int) string { } // getFirstMessage returns the message from the ordered list of conditions in the top group. -func getFirstMessage(groups conditionGroups, order []vmopv1.ConditionType) string { +func getFirstMessage(groups conditionGroups, order []vmopv1a1.ConditionType) string { if condition := getFirstCondition(groups, order); condition != nil { return condition.Message } @@ -145,7 +145,7 @@ func getFirstMessage(groups conditionGroups, order []vmopv1.ConditionType) strin } // getFirstCondition returns a first condition from the ordered list of conditions in the top group. -func getFirstCondition(g conditionGroups, priority []vmopv1.ConditionType) *localizedCondition { +func getFirstCondition(g conditionGroups, priority []vmopv1a1.ConditionType) *localizedCondition { topGroup := g.TopGroup() if topGroup == nil { return nil diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge_strategies_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge_strategies_test.go index 968ea5940..a5575ed87 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge_strategies_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge_strategies_test.go @@ -22,13 +22,13 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) func TestGetStepCounterMessage(t *testing.T) { g := NewWithT(t) - groups := getConditionGroups(conditionsWithSource(&vmopv1.VirtualMachine{}, + groups := getConditionGroups(conditionsWithSource(&vmopv1a1.VirtualMachine{}, nil1, true1, true1, falseInfo1, @@ -46,7 +46,7 @@ func TestGetStepCounterMessage(t *testing.T) { func TestLocalizeReason(t *testing.T) { g := NewWithT(t) - getter := &vmopv1.VirtualMachine{ + getter := &vmopv1a1.VirtualMachine{ TypeMeta: metav1.TypeMeta{ Kind: "VirtualMachine", }, @@ -67,10 +67,10 @@ func TestLocalizeReason(t *testing.T) { func TestGetFirstReasonAndMessage(t *testing.T) { g := NewWithT(t) - foo := FalseCondition("foo", "falseFoo", vmopv1.ConditionSeverityInfo, "message falseFoo") - bar := FalseCondition("bar", "falseBar", vmopv1.ConditionSeverityInfo, "message falseBar") + foo := FalseCondition("foo", "falseFoo", vmopv1a1.ConditionSeverityInfo, "message falseFoo") + bar := FalseCondition("bar", "falseBar", vmopv1a1.ConditionSeverityInfo, "message falseBar") - getter := &vmopv1.VirtualMachine{ + getter := &vmopv1a1.VirtualMachine{ TypeMeta: metav1.TypeMeta{ Kind: "VirtualMachine", }, @@ -88,21 +88,21 @@ func TestGetFirstReasonAndMessage(t *testing.T) { g.Expect(gotMessage).To(Equal("message falseBar")) // getFirst should report should respect order - gotReason = getFirstReason(groups, []vmopv1.ConditionType{"foo", "bar"}, false) + gotReason = getFirstReason(groups, []vmopv1a1.ConditionType{"foo", "bar"}, false) g.Expect(gotReason).To(Equal("falseFoo")) - gotMessage = getFirstMessage(groups, []vmopv1.ConditionType{"foo", "bar"}) + gotMessage = getFirstMessage(groups, []vmopv1a1.ConditionType{"foo", "bar"}) g.Expect(gotMessage).To(Equal("message falseFoo")) // getFirst should report should respect order in case of missing conditions - gotReason = getFirstReason(groups, []vmopv1.ConditionType{"missingBaz", "foo", "bar"}, false) + gotReason = getFirstReason(groups, []vmopv1a1.ConditionType{"missingBaz", "foo", "bar"}, false) g.Expect(gotReason).To(Equal("falseFoo")) - gotMessage = getFirstMessage(groups, []vmopv1.ConditionType{"missingBaz", "foo", "bar"}) + gotMessage = getFirstMessage(groups, []vmopv1a1.ConditionType{"missingBaz", "foo", "bar"}) g.Expect(gotMessage).To(Equal("message falseFoo")) // getFirst should fallback to first condition if none of the conditions in the list exists - gotReason = getFirstReason(groups, []vmopv1.ConditionType{"missingBaz"}, false) + gotReason = getFirstReason(groups, []vmopv1a1.ConditionType{"missingBaz"}, false) g.Expect(gotReason).To(Equal("falseBar")) - gotMessage = getFirstMessage(groups, []vmopv1.ConditionType{"missingBaz"}) + gotMessage = getFirstMessage(groups, []vmopv1a1.ConditionType{"missingBaz"}) g.Expect(gotMessage).To(Equal("message falseBar")) // getFirstReason should localize reason if required diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge_test.go index 1cfc2eca9..e33481f49 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/merge_test.go @@ -23,62 +23,62 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) func TestNewConditionsGroup(t *testing.T) { g := NewWithT(t) - conditions := []*vmopv1.Condition{nil1, true1, true1, falseInfo1, falseWarning1, falseWarning1, falseError1, unknown1} + conditions := []*vmopv1a1.Condition{nil1, true1, true1, falseInfo1, falseWarning1, falseWarning1, falseError1, unknown1} - got := getConditionGroups(conditionsWithSource(&vmopv1.VirtualMachine{}, conditions...)) + got := getConditionGroups(conditionsWithSource(&vmopv1a1.VirtualMachine{}, conditions...)) g.Expect(got).ToNot(BeNil()) g.Expect(got).To(HaveLen(5)) // The top group should be False/Error and it should have one condition g.Expect(got.TopGroup().status).To(Equal(corev1.ConditionFalse)) - g.Expect(got.TopGroup().severity).To(Equal(vmopv1.ConditionSeverityError)) + g.Expect(got.TopGroup().severity).To(Equal(vmopv1a1.ConditionSeverityError)) g.Expect(got.TopGroup().conditions).To(HaveLen(1)) // The true group should be true and it should have two conditions g.Expect(got.TrueGroup().status).To(Equal(corev1.ConditionTrue)) - g.Expect(got.TrueGroup().severity).To(Equal(vmopv1.ConditionSeverityNone)) + g.Expect(got.TrueGroup().severity).To(Equal(vmopv1a1.ConditionSeverityNone)) g.Expect(got.TrueGroup().conditions).To(HaveLen(2)) // The error group should be False/Error and it should have one condition g.Expect(got.ErrorGroup().status).To(Equal(corev1.ConditionFalse)) - g.Expect(got.ErrorGroup().severity).To(Equal(vmopv1.ConditionSeverityError)) + g.Expect(got.ErrorGroup().severity).To(Equal(vmopv1a1.ConditionSeverityError)) g.Expect(got.ErrorGroup().conditions).To(HaveLen(1)) // The warning group should be False/Warning and it should have two conditions g.Expect(got.WarningGroup().status).To(Equal(corev1.ConditionFalse)) - g.Expect(got.WarningGroup().severity).To(Equal(vmopv1.ConditionSeverityWarning)) + g.Expect(got.WarningGroup().severity).To(Equal(vmopv1a1.ConditionSeverityWarning)) g.Expect(got.WarningGroup().conditions).To(HaveLen(2)) // got[0] should be False/Error and it should have one condition g.Expect(got[0].status).To(Equal(corev1.ConditionFalse)) - g.Expect(got[0].severity).To(Equal(vmopv1.ConditionSeverityError)) + g.Expect(got[0].severity).To(Equal(vmopv1a1.ConditionSeverityError)) g.Expect(got[0].conditions).To(HaveLen(1)) // got[1] should be False/Warning and it should have two conditions g.Expect(got[1].status).To(Equal(corev1.ConditionFalse)) - g.Expect(got[1].severity).To(Equal(vmopv1.ConditionSeverityWarning)) + g.Expect(got[1].severity).To(Equal(vmopv1a1.ConditionSeverityWarning)) g.Expect(got[1].conditions).To(HaveLen(2)) // got[2] should be False/Info and it should have one condition g.Expect(got[2].status).To(Equal(corev1.ConditionFalse)) - g.Expect(got[2].severity).To(Equal(vmopv1.ConditionSeverityInfo)) + g.Expect(got[2].severity).To(Equal(vmopv1a1.ConditionSeverityInfo)) g.Expect(got[2].conditions).To(HaveLen(1)) // got[3] should be True and it should have two conditions g.Expect(got[3].status).To(Equal(corev1.ConditionTrue)) - g.Expect(got[3].severity).To(Equal(vmopv1.ConditionSeverityNone)) + g.Expect(got[3].severity).To(Equal(vmopv1a1.ConditionSeverityNone)) g.Expect(got[3].conditions).To(HaveLen(2)) // got[4] should be Unknown and it should have one condition g.Expect(got[4].status).To(Equal(corev1.ConditionUnknown)) - g.Expect(got[4].severity).To(Equal(vmopv1.ConditionSeverityNone)) + g.Expect(got[4].severity).To(Equal(vmopv1a1.ConditionSeverityNone)) g.Expect(got[4].conditions).To(HaveLen(1)) // nil conditions are ignored @@ -87,8 +87,8 @@ func TestNewConditionsGroup(t *testing.T) { func TestMergeRespectPriority(t *testing.T) { tests := []struct { name string - conditions []*vmopv1.Condition - want *vmopv1.Condition + conditions []*vmopv1a1.Condition + want *vmopv1a1.Condition }{ { name: "aggregate nil list return nil", @@ -97,37 +97,37 @@ func TestMergeRespectPriority(t *testing.T) { }, { name: "aggregate empty list return nil", - conditions: []*vmopv1.Condition{}, + conditions: []*vmopv1a1.Condition{}, want: nil, }, { name: "When there is false/error it returns false/error", - conditions: []*vmopv1.Condition{falseError1, falseWarning1, falseInfo1, unknown1, true1}, - want: FalseCondition("foo", "reason falseError1", vmopv1.ConditionSeverityError, "message falseError1"), + conditions: []*vmopv1a1.Condition{falseError1, falseWarning1, falseInfo1, unknown1, true1}, + want: FalseCondition("foo", "reason falseError1", vmopv1a1.ConditionSeverityError, "message falseError1"), }, { name: "When there is false/warning and no false/error, it returns false/warning", - conditions: []*vmopv1.Condition{falseWarning1, falseInfo1, unknown1, true1}, - want: FalseCondition("foo", "reason falseWarning1", vmopv1.ConditionSeverityWarning, "message falseWarning1"), + conditions: []*vmopv1a1.Condition{falseWarning1, falseInfo1, unknown1, true1}, + want: FalseCondition("foo", "reason falseWarning1", vmopv1a1.ConditionSeverityWarning, "message falseWarning1"), }, { name: "When there is false/info and no false/error or false/warning, it returns false/info", - conditions: []*vmopv1.Condition{falseInfo1, unknown1, true1}, - want: FalseCondition("foo", "reason falseInfo1", vmopv1.ConditionSeverityInfo, "message falseInfo1"), + conditions: []*vmopv1a1.Condition{falseInfo1, unknown1, true1}, + want: FalseCondition("foo", "reason falseInfo1", vmopv1a1.ConditionSeverityInfo, "message falseInfo1"), }, { name: "When there is true and no false/*, it returns info", - conditions: []*vmopv1.Condition{unknown1, true1}, + conditions: []*vmopv1a1.Condition{unknown1, true1}, want: TrueCondition("foo"), }, { name: "When there is unknown and no true or false/*, it returns unknown", - conditions: []*vmopv1.Condition{unknown1}, + conditions: []*vmopv1a1.Condition{unknown1}, want: UnknownCondition("foo", "reason unknown1", "message unknown1"), }, { name: "nil conditions are ignored", - conditions: []*vmopv1.Condition{nil1, nil1, nil1}, + conditions: []*vmopv1a1.Condition{nil1, nil1, nil1}, want: nil, }, } @@ -136,7 +136,7 @@ func TestMergeRespectPriority(t *testing.T) { t.Run(tt.name, func(t *testing.T) { g := NewWithT(t) - got := merge(conditionsWithSource(&vmopv1.VirtualMachine{}, tt.conditions...), "foo", &mergeOptions{}) + got := merge(conditionsWithSource(&vmopv1a1.VirtualMachine{}, tt.conditions...), "foo", &mergeOptions{}) if tt.want == nil { g.Expect(got).To(BeNil()) @@ -147,7 +147,7 @@ func TestMergeRespectPriority(t *testing.T) { } } -func conditionsWithSource(obj Setter, conditions ...*vmopv1.Condition) []localizedCondition { +func conditionsWithSource(obj Setter, conditions ...*vmopv1a1.Condition) []localizedCondition { obj.SetConditions(conditionList(conditions...)) ret := []localizedCondition{} diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/patch.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/patch.go index d2d7b29fb..9e560471a 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/patch.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/patch.go @@ -22,7 +22,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/pkg/errors" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) // Patch defines a list of operations to change a list of conditions into another. @@ -30,8 +30,8 @@ type Patch []PatchOperation // PatchOperation define an operation that changes a single condition. type PatchOperation struct { - Before *vmopv1.Condition - After *vmopv1.Condition + Before *vmopv1a1.Condition + After *vmopv1a1.Condition Op PatchOperationType } @@ -82,11 +82,11 @@ func NewPatch(before Getter, after Getter) Patch { // applyOptions allows to set strategies for patch apply. type applyOptions struct { - ownedConditions []vmopv1.ConditionType + ownedConditions []vmopv1a1.ConditionType forceOverwrite bool } -func (o *applyOptions) isOwnedCondition(t vmopv1.ConditionType) bool { +func (o *applyOptions) isOwnedCondition(t vmopv1a1.ConditionType) bool { for _, i := range o.ownedConditions { if i == t { return true @@ -100,7 +100,7 @@ type ApplyOption func(*applyOptions) // WithOwnedConditions allows to define condition types owned by the controller. // In case of conflicts for the owned conditions, the patch helper will always use the value provided by the controller. -func WithOwnedConditions(t ...vmopv1.ConditionType) ApplyOption { +func WithOwnedConditions(t ...vmopv1a1.ConditionType) ApplyOption { return func(c *applyOptions) { c.ownedConditions = t } diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/patch_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/patch_test.go index 387802fb0..500d0cac5 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/patch_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/patch_test.go @@ -25,12 +25,12 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) func TestNewPatch(t *testing.T) { fooTrue := TrueCondition("foo") - fooFalse := FalseCondition("foo", "reason foo", vmopv1.ConditionSeverityInfo, "message foo") + fooFalse := FalseCondition("foo", "reason foo", vmopv1a1.ConditionSeverityInfo, "message foo") tests := []struct { name string @@ -101,8 +101,8 @@ func TestNewPatch(t *testing.T) { func TestApply(t *testing.T) { fooTrue := TrueCondition("foo") - fooFalse := FalseCondition("foo", "reason foo", vmopv1.ConditionSeverityInfo, "message foo") - fooWarning := FalseCondition("foo", "reason foo", vmopv1.ConditionSeverityWarning, "message foo") + fooFalse := FalseCondition("foo", "reason foo", vmopv1a1.ConditionSeverityInfo, "message foo") + fooWarning := FalseCondition("foo", "reason foo", vmopv1a1.ConditionSeverityWarning, "message foo") tests := []struct { name string @@ -110,7 +110,7 @@ func TestApply(t *testing.T) { after Getter latest Setter options []ApplyOption - want vmopv1.Conditions + want vmopv1a1.Conditions wantErr bool }{ { @@ -260,11 +260,11 @@ func TestApply(t *testing.T) { func TestApplyDoesNotAlterLastTransitionTime(t *testing.T) { g := NewWithT(t) - before := &vmopv1.VirtualMachine{} - after := &vmopv1.VirtualMachine{ - Status: vmopv1.VirtualMachineStatus{ - Conditions: vmopv1.Conditions{ - vmopv1.Condition{ + before := &vmopv1a1.VirtualMachine{} + after := &vmopv1a1.VirtualMachine{ + Status: vmopv1a1.VirtualMachineStatus{ + Conditions: vmopv1a1.Conditions{ + vmopv1a1.Condition{ Type: "foo", Status: corev1.ConditionTrue, LastTransitionTime: metav1.NewTime(time.Now().UTC().Truncate(time.Second)), @@ -272,7 +272,7 @@ func TestApplyDoesNotAlterLastTransitionTime(t *testing.T) { }, }, } - latest := &vmopv1.VirtualMachine{} + latest := &vmopv1a1.VirtualMachine{} // latest has no conditions, so we are actually adding the condition but in this case we should not set the LastTransition Time // but we should preserve the LastTransition set in after diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/setter.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/setter.go index 26f292ba5..929c670b5 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/setter.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/setter.go @@ -24,21 +24,21 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) // Setter interface defines methods that a Cluster API object should implement in order to // use the conditions package for setting conditions. type Setter interface { Getter - SetConditions(vmopv1.Conditions) + SetConditions(vmopv1a1.Conditions) } // Set sets the given condition. // // NOTE: If a condition already exists, the LastTransitionTime is updated only if a change is detected // in any of the following fields: Status, Reason, Severity and Message. -func Set(to Setter, condition *vmopv1.Condition) { +func Set(to Setter, condition *vmopv1a1.Condition) { if to == nil || condition == nil { return } @@ -78,16 +78,16 @@ func Set(to Setter, condition *vmopv1.Condition) { } // TrueCondition returns a condition with Status=True and the given type. -func TrueCondition(t vmopv1.ConditionType) *vmopv1.Condition { - return &vmopv1.Condition{ +func TrueCondition(t vmopv1a1.ConditionType) *vmopv1a1.Condition { + return &vmopv1a1.Condition{ Type: t, Status: corev1.ConditionTrue, } } // FalseCondition returns a condition with Status=False and the given type. -func FalseCondition(t vmopv1.ConditionType, reason string, severity vmopv1.ConditionSeverity, messageFormat string, messageArgs ...interface{}) *vmopv1.Condition { - return &vmopv1.Condition{ +func FalseCondition(t vmopv1a1.ConditionType, reason string, severity vmopv1a1.ConditionSeverity, messageFormat string, messageArgs ...interface{}) *vmopv1a1.Condition { + return &vmopv1a1.Condition{ Type: t, Status: corev1.ConditionFalse, Reason: reason, @@ -97,8 +97,8 @@ func FalseCondition(t vmopv1.ConditionType, reason string, severity vmopv1.Condi } // UnknownCondition returns a condition with Status=Unknown and the given type. -func UnknownCondition(t vmopv1.ConditionType, reason string, messageFormat string, messageArgs ...interface{}) *vmopv1.Condition { - return &vmopv1.Condition{ +func UnknownCondition(t vmopv1a1.ConditionType, reason string, messageFormat string, messageArgs ...interface{}) *vmopv1a1.Condition { + return &vmopv1a1.Condition{ Type: t, Status: corev1.ConditionUnknown, Reason: reason, @@ -107,17 +107,17 @@ func UnknownCondition(t vmopv1.ConditionType, reason string, messageFormat strin } // MarkTrue sets Status=True for the condition with the given type. -func MarkTrue(to Setter, t vmopv1.ConditionType) { +func MarkTrue(to Setter, t vmopv1a1.ConditionType) { Set(to, TrueCondition(t)) } // MarkUnknown sets Status=Unknown for the condition with the given type. -func MarkUnknown(to Setter, t vmopv1.ConditionType, reason, messageFormat string, messageArgs ...interface{}) { +func MarkUnknown(to Setter, t vmopv1a1.ConditionType, reason, messageFormat string, messageArgs ...interface{}) { Set(to, UnknownCondition(t, reason, messageFormat, messageArgs...)) } // MarkFalse sets Status=False for the condition with the given type. -func MarkFalse(to Setter, t vmopv1.ConditionType, reason string, severity vmopv1.ConditionSeverity, messageFormat string, messageArgs ...interface{}) { +func MarkFalse(to Setter, t vmopv1a1.ConditionType, reason string, severity vmopv1a1.ConditionSeverity, messageFormat string, messageArgs ...interface{}) { Set(to, FalseCondition(t, reason, severity, messageFormat, messageArgs...)) } @@ -129,7 +129,7 @@ func SetSummary(to Setter, options ...MergeOption) { // SetMirror creates a new condition by mirroring the the Ready condition from a dependent object; // if the Ready condition does not exists in the source object, no target conditions is generated. -func SetMirror(to Setter, targetCondition vmopv1.ConditionType, from Getter, options ...MirrorOptions) { +func SetMirror(to Setter, targetCondition vmopv1a1.ConditionType, from Getter, options ...MirrorOptions) { Set(to, mirror(from, targetCondition, options...)) } @@ -137,18 +137,18 @@ func SetMirror(to Setter, targetCondition vmopv1.ConditionType, from Getter, opt // from a list of dependent objects; if the Ready condition does not exists in one of the source object, // the object is excluded from the aggregation; if none of the source object have ready condition, // no target conditions is generated. -func SetAggregate(to Setter, targetCondition vmopv1.ConditionType, from []Getter, options ...MergeOption) { +func SetAggregate(to Setter, targetCondition vmopv1a1.ConditionType, from []Getter, options ...MergeOption) { Set(to, aggregate(from, targetCondition, options...)) } // Delete deletes the condition with the given type. -func Delete(to Setter, t vmopv1.ConditionType) { +func Delete(to Setter, t vmopv1a1.ConditionType) { if to == nil { return } conditions := to.GetConditions() - newConditions := make(vmopv1.Conditions, 0, len(conditions)) + newConditions := make(vmopv1a1.Conditions, 0, len(conditions)) for _, condition := range conditions { if condition.Type != t { newConditions = append(newConditions, condition) @@ -161,13 +161,13 @@ func Delete(to Setter, t vmopv1.ConditionType) { // to order of conditions designed for convenience of the consumer, i.e. kubectl. // According to this order the Ready condition always goes first, followed by all the other // conditions sorted by Type. -func lexicographicLess(i, j *vmopv1.Condition) bool { - return (i.Type == vmopv1.ReadyCondition || i.Type < j.Type) && j.Type != vmopv1.ReadyCondition +func lexicographicLess(i, j *vmopv1a1.Condition) bool { + return (i.Type == vmopv1a1.ReadyCondition || i.Type < j.Type) && j.Type != vmopv1a1.ReadyCondition } // hasSameState returns true if a condition has the same state of another; state is defined // by the union of following fields: Type, Status, Reason, Severity and Message (it excludes LastTransitionTime). -func hasSameState(i, j *vmopv1.Condition) bool { +func hasSameState(i, j *vmopv1a1.Condition) bool { return i.Type == j.Type && i.Status == j.Status && i.Reason == j.Reason && diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/setter_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/setter_test.go index fcfe2588c..2249d87aa 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/setter_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/setter_test.go @@ -28,7 +28,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) func TestHasSameState(t *testing.T) { @@ -53,7 +53,7 @@ func TestHasSameState(t *testing.T) { g.Expect(hasSameState(falseInfo1, falseInfo2)).To(BeFalse()) falseInfo2 = falseInfo1.DeepCopy() - falseInfo2.Severity = vmopv1.ConditionSeverityWarning + falseInfo2.Severity = vmopv1a1.ConditionSeverityWarning g.Expect(hasSameState(falseInfo1, falseInfo2)).To(BeFalse()) falseInfo2 = falseInfo1.DeepCopy() @@ -78,25 +78,25 @@ func TestLexicographicLess(t *testing.T) { g.Expect(lexicographicLess(a, b)).To(BeFalse()) // Ready condition is treated as an exception and always goes first - a = TrueCondition(vmopv1.ReadyCondition) + a = TrueCondition(vmopv1a1.ReadyCondition) b = TrueCondition("A") g.Expect(lexicographicLess(a, b)).To(BeTrue()) a = TrueCondition("A") - b = TrueCondition(vmopv1.ReadyCondition) + b = TrueCondition(vmopv1a1.ReadyCondition) g.Expect(lexicographicLess(a, b)).To(BeFalse()) } func TestSet(t *testing.T) { a := TrueCondition("a") b := TrueCondition("b") - ready := TrueCondition(vmopv1.ReadyCondition) + ready := TrueCondition(vmopv1a1.ReadyCondition) tests := []struct { name string to Setter - condition *vmopv1.Condition - want vmopv1.Conditions + condition *vmopv1a1.Condition + want vmopv1a1.Conditions }{ { name: "Set adds a condition", @@ -138,15 +138,15 @@ func TestSet(t *testing.T) { func TestSetLastTransitionTime(t *testing.T) { x := metav1.Date(2012, time.January, 1, 12, 15, 30, 5e8, time.UTC) - foo := FalseCondition("foo", "reason foo", vmopv1.ConditionSeverityInfo, "message foo") - fooWithLastTransitionTime := FalseCondition("foo", "reason foo", vmopv1.ConditionSeverityInfo, "message foo") + foo := FalseCondition("foo", "reason foo", vmopv1a1.ConditionSeverityInfo, "message foo") + fooWithLastTransitionTime := FalseCondition("foo", "reason foo", vmopv1a1.ConditionSeverityInfo, "message foo") fooWithLastTransitionTime.LastTransitionTime = x fooWithAnotherState := TrueCondition("foo") tests := []struct { name string to Setter - new *vmopv1.Condition + new *vmopv1a1.Condition LastTransitionTimeCheck func(*WithT, metav1.Time) }{ { @@ -197,28 +197,28 @@ func TestSetLastTransitionTime(t *testing.T) { func TestMarkMethods(t *testing.T) { g := NewWithT(t) - vm := &vmopv1.VirtualMachine{} + vm := &vmopv1a1.VirtualMachine{} // test MarkTrue MarkTrue(vm, "conditionFoo") - g.Expect(Get(vm, "conditionFoo")).To(haveSameStateOf(&vmopv1.Condition{ + g.Expect(Get(vm, "conditionFoo")).To(haveSameStateOf(&vmopv1a1.Condition{ Type: "conditionFoo", Status: corev1.ConditionTrue, })) // test MarkFalse - MarkFalse(vm, "conditionBar", "reasonBar", vmopv1.ConditionSeverityError, "messageBar") - g.Expect(Get(vm, "conditionBar")).To(haveSameStateOf(&vmopv1.Condition{ + MarkFalse(vm, "conditionBar", "reasonBar", vmopv1a1.ConditionSeverityError, "messageBar") + g.Expect(Get(vm, "conditionBar")).To(haveSameStateOf(&vmopv1a1.Condition{ Type: "conditionBar", Status: corev1.ConditionFalse, - Severity: vmopv1.ConditionSeverityError, + Severity: vmopv1a1.ConditionSeverityError, Reason: "reasonBar", Message: "messageBar", })) // test MarkUnknown MarkUnknown(vm, "conditionBaz", "reasonBaz", "messageBaz") - g.Expect(Get(vm, "conditionBaz")).To(haveSameStateOf(&vmopv1.Condition{ + g.Expect(Get(vm, "conditionBaz")).To(haveSameStateOf(&vmopv1a1.Condition{ Type: "conditionBaz", Status: corev1.ConditionUnknown, Reason: "reasonBaz", @@ -232,12 +232,12 @@ func TestSetSummary(t *testing.T) { SetSummary(target) - g.Expect(Has(target, vmopv1.ReadyCondition)).To(BeTrue()) + g.Expect(Has(target, vmopv1a1.ReadyCondition)).To(BeTrue()) } func TestSetMirror(t *testing.T) { g := NewWithT(t) - source := getterWithConditions(TrueCondition(vmopv1.ReadyCondition)) + source := getterWithConditions(TrueCondition(vmopv1a1.ReadyCondition)) target := setterWithConditions() SetMirror(target, "foo", source) @@ -247,8 +247,8 @@ func TestSetMirror(t *testing.T) { func TestSetAggregate(t *testing.T) { g := NewWithT(t) - source1 := getterWithConditions(TrueCondition(vmopv1.ReadyCondition)) - source2 := getterWithConditions(TrueCondition(vmopv1.ReadyCondition)) + source1 := getterWithConditions(TrueCondition(vmopv1a1.ReadyCondition)) + source2 := getterWithConditions(TrueCondition(vmopv1a1.ReadyCondition)) target := setterWithConditions() SetAggregate(target, "foo", []Getter{source1, source2}) @@ -256,24 +256,24 @@ func TestSetAggregate(t *testing.T) { g.Expect(Has(target, "foo")).To(BeTrue()) } -func setterWithConditions(conditions ...*vmopv1.Condition) Setter { - obj := &vmopv1.VirtualMachine{} +func setterWithConditions(conditions ...*vmopv1a1.Condition) Setter { + obj := &vmopv1a1.VirtualMachine{} obj.SetConditions(conditionList(conditions...)) return obj } -func haveSameConditionsOf(expected vmopv1.Conditions) types.GomegaMatcher { +func haveSameConditionsOf(expected vmopv1a1.Conditions) types.GomegaMatcher { return &ConditionsMatcher{ Expected: expected, } } type ConditionsMatcher struct { - Expected vmopv1.Conditions + Expected vmopv1a1.Conditions } func (matcher *ConditionsMatcher) Match(actual interface{}) (success bool, err error) { - actualConditions, ok := actual.(vmopv1.Conditions) + actualConditions, ok := actual.(vmopv1a1.Conditions) if !ok { return false, errors.New("Value should be a conditions list") } diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/unstructured.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/unstructured.go index c59703d63..d9f4b9ea3 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/unstructured.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/unstructured.go @@ -21,7 +21,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/controller-runtime/pkg/log" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) // UnstructuredGetter return a Getter object that can read conditions from an Unstructured object. @@ -49,8 +49,8 @@ type unstructuredWrapper struct { // in both cases the operation returns an empty slice is returned. // - If the object doesn't implement conditions on under status as defined in Cluster API, // JSON-unmarshal matches incoming object keys to the keys; this can lead to to conditions values partially set. -func (c *unstructuredWrapper) GetConditions() vmopv1.Conditions { - conditions := vmopv1.Conditions{} +func (c *unstructuredWrapper) GetConditions() vmopv1a1.Conditions { + conditions := vmopv1a1.Conditions{} if err := UnstructuredUnmarshalField(c.Unstructured, &conditions, "status", "conditions"); err != nil { return nil } @@ -64,7 +64,7 @@ func (c *unstructuredWrapper) GetConditions() vmopv1.Conditions { // - Errors during JSON-unmarshal are ignored and a empty collection list is returned. // - It's not possible to detect if the object has an empty condition list or if it does not implement conditions; // in both cases the operation returns an empty slice is returned. -func (c *unstructuredWrapper) SetConditions(conditions vmopv1.Conditions) { +func (c *unstructuredWrapper) SetConditions(conditions vmopv1a1.Conditions) { v := make([]interface{}, 0, len(conditions)) for i := range conditions { m, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&conditions[i]) diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/unstructured_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/unstructured_test.go index 6d6881561..065ad582d 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/unstructured_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions/unstructured_test.go @@ -25,7 +25,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) func TestUnstructuredGetConditions(t *testing.T) { @@ -33,10 +33,10 @@ func TestUnstructuredGetConditions(t *testing.T) { scheme := runtime.NewScheme() g.Expect(corev1.AddToScheme(scheme)).To(Succeed()) - g.Expect(vmopv1.AddToScheme(scheme)).To(Succeed()) + g.Expect(vmopv1a1.AddToScheme(scheme)).To(Succeed()) // GetConditions should return conditions from an unstructured object - c := &vmopv1.VirtualMachine{} + c := &vmopv1a1.VirtualMachine{} c.SetConditions(conditionList(true1)) u := &unstructured.Unstructured{} g.Expect(scheme.Convert(c, u, nil)).To(Succeed()) @@ -44,7 +44,7 @@ func TestUnstructuredGetConditions(t *testing.T) { g.Expect(UnstructuredGetter(u).GetConditions()).To(haveSameConditionsOf(conditionList(true1))) // GetConditions should return nil for an unstructured object with empty conditions - c = &vmopv1.VirtualMachine{} + c = &vmopv1a1.VirtualMachine{} u = &unstructured.Unstructured{} g.Expect(scheme.Convert(c, u, nil)).To(Succeed()) @@ -82,9 +82,9 @@ func TestUnstructuredSetConditions(t *testing.T) { // gets an unstructured with empty conditions scheme := runtime.NewScheme() g.Expect(corev1.AddToScheme(scheme)).To(Succeed()) - g.Expect(vmopv1.AddToScheme(scheme)).To(Succeed()) + g.Expect(vmopv1a1.AddToScheme(scheme)).To(Succeed()) - c := &vmopv1.VirtualMachine{} + c := &vmopv1a1.VirtualMachine{} u := &unstructured.Unstructured{} g.Expect(scheme.Convert(c, u, nil)).To(Succeed()) diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/options.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/options.go index b55f5fac4..263db7d97 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/options.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/options.go @@ -13,7 +13,7 @@ limitations under the License. package patch -import vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" +import vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" // Option is some configuration that modifies options for a patch request. type Option interface { @@ -33,7 +33,7 @@ type HelperOptions struct { // OwnedConditions defines condition types owned by the controller. // In case of conflicts for the owned conditions, the patch helper will always use the value provided by the controller. - OwnedConditions []vmopv1.ConditionType + OwnedConditions []vmopv1a1.ConditionType } // WithForceOverwriteConditions allows the patch helper to overwrite conditions in case of conflicts. @@ -57,7 +57,7 @@ func (w WithStatusObservedGeneration) ApplyToHelper(in *HelperOptions) { // WithOwnedConditions allows to define condition types owned by the controller. // In case of conflicts for the owned conditions, the patch helper will always use the value provided by the controller. type WithOwnedConditions struct { - Conditions []vmopv1.ConditionType + Conditions []vmopv1a1.ConditionType } // ApplyToHelper applies this configuration to the given HelperOptions. diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/patch.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/patch.go index 230689f38..9857d46bb 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/patch.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/patch.go @@ -29,7 +29,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions" ) @@ -174,7 +174,7 @@ func (h *Helper) patchStatus(ctx context.Context, obj client.Object) error { // // Condition changes are then applied to the latest version of the object, and if there are // no unresolvable conflicts, the patch is sent again. -func (h *Helper) patchStatusConditions(ctx context.Context, obj client.Object, forceOverwrite bool, ownedConditions []vmopv1.ConditionType) error { +func (h *Helper) patchStatusConditions(ctx context.Context, obj client.Object, forceOverwrite bool, ownedConditions []vmopv1a1.ConditionType) error { // Nothing to do if the object isn't a condition patcher. if !h.isConditionsSetter { return nil diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/patch_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/patch_test.go index e72e9b2bd..c6902d0ba 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/patch_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/patch_test.go @@ -31,7 +31,7 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -161,13 +161,13 @@ func intgTestsPatch() { }) Describe("on a vmopv1.VirtualMachine object", func() { - obj := &vmopv1.VirtualMachine{ + obj := &vmopv1a1.VirtualMachine{ ObjectMeta: metav1.ObjectMeta{ GenerateName: "test-", Namespace: "default", }, - Spec: vmopv1.VirtualMachineSpec{ - PowerState: vmopv1.VirtualMachinePoweredOn, + Spec: vmopv1a1.VirtualMachineSpec{ + PowerState: vmopv1a1.VirtualMachinePoweredOn, }, } @@ -186,7 +186,7 @@ func intgTestsPatch() { Expect(err).NotTo(HaveOccurred()) By("Marking Ready=True") - conditions.MarkTrue(obj, vmopv1.ReadyCondition) + conditions.MarkTrue(obj, vmopv1a1.ReadyCondition) By("Patching the object") Expect(patcher.Patch(ctx, obj)).To(Succeed()) @@ -213,7 +213,7 @@ func intgTestsPatch() { objCopy := obj.DeepCopy() By("Marking a custom condition to be false") - conditions.MarkFalse(objCopy, vmopv1.ConditionType("TestCondition"), "reason", vmopv1.ConditionSeverityInfo, "message") + conditions.MarkFalse(objCopy, vmopv1a1.ConditionType("TestCondition"), "reason", vmopv1a1.ConditionSeverityInfo, "message") Expect(ctx.Client.Status().Update(ctx, objCopy)).To(Succeed()) By("Validating that the local object's resource version is behind") @@ -224,7 +224,7 @@ func intgTestsPatch() { Expect(err).NotTo(HaveOccurred()) By("Marking Ready=True") - conditions.MarkTrue(obj, vmopv1.ReadyCondition) + conditions.MarkTrue(obj, vmopv1a1.ReadyCondition) By("Patching the object") Expect(patcher.Patch(ctx, obj)).To(Succeed()) @@ -239,8 +239,8 @@ func intgTestsPatch() { testConditionCopy := conditions.Get(objCopy, "TestCondition") testConditionAfter := conditions.Get(objAfter, "TestCondition") - readyBefore := conditions.Get(obj, vmopv1.ReadyCondition) - readyAfter := conditions.Get(objAfter, vmopv1.ReadyCondition) + readyBefore := conditions.Get(obj, vmopv1a1.ReadyCondition) + readyAfter := conditions.Get(objAfter, vmopv1a1.ReadyCondition) return cmp.Equal(testConditionCopy, testConditionAfter) && cmp.Equal(readyBefore, readyAfter) }, timeout).Should(BeTrue()) @@ -260,7 +260,7 @@ func intgTestsPatch() { objCopy := obj.DeepCopy() By("Marking a custom condition to be false") - conditions.MarkFalse(objCopy, vmopv1.ConditionType("TestCondition"), "reason", vmopv1.ConditionSeverityInfo, "message") + conditions.MarkFalse(objCopy, vmopv1a1.ConditionType("TestCondition"), "reason", vmopv1a1.ConditionSeverityInfo, "message") Expect(ctx.Client.Status().Update(ctx, objCopy)).To(Succeed()) By("Validating that the local object's resource version is behind") @@ -273,7 +273,7 @@ func intgTestsPatch() { By("Changing the object spec, status, and adding Ready=True condition") obj.Spec.ImageName = "foo-image" obj.Status.Phase = "custom-phase" - conditions.MarkTrue(obj, vmopv1.ReadyCondition) + conditions.MarkTrue(obj, vmopv1a1.ReadyCondition) By("Patching the object") Expect(patcher.Patch(ctx, obj)).To(Succeed()) @@ -288,8 +288,8 @@ func intgTestsPatch() { testConditionCopy := conditions.Get(objCopy, "TestCondition") testConditionAfter := conditions.Get(objAfter, "TestCondition") - readyBefore := conditions.Get(obj, vmopv1.ReadyCondition) - readyAfter := conditions.Get(objAfter, vmopv1.ReadyCondition) + readyBefore := conditions.Get(obj, vmopv1a1.ReadyCondition) + readyAfter := conditions.Get(objAfter, vmopv1a1.ReadyCondition) return cmp.Equal(testConditionCopy, testConditionAfter) && cmp.Equal(readyBefore, readyAfter) && obj.Spec.ImageName == objAfter.Spec.ImageName && @@ -309,7 +309,7 @@ func intgTestsPatch() { objCopy := obj.DeepCopy() By("Marking a custom condition to be false") - conditions.MarkFalse(objCopy, vmopv1.ReadyCondition, "reason", vmopv1.ConditionSeverityInfo, "message") + conditions.MarkFalse(objCopy, vmopv1a1.ReadyCondition, "reason", vmopv1a1.ConditionSeverityInfo, "message") Expect(ctx.Client.Status().Update(ctx, objCopy)).To(Succeed()) By("Validating that the local object's resource version is behind") @@ -320,7 +320,7 @@ func intgTestsPatch() { Expect(err).NotTo(HaveOccurred()) By("Marking Ready=True") - conditions.MarkTrue(obj, vmopv1.ReadyCondition) + conditions.MarkTrue(obj, vmopv1a1.ReadyCondition) By("Patching the object") Expect(patcher.Patch(ctx, obj)).ToNot(Succeed()) @@ -348,7 +348,7 @@ func intgTestsPatch() { objCopy := obj.DeepCopy() By("Marking a custom condition to be false") - conditions.MarkFalse(objCopy, vmopv1.ReadyCondition, "reason", vmopv1.ConditionSeverityInfo, "message") + conditions.MarkFalse(objCopy, vmopv1a1.ReadyCondition, "reason", vmopv1a1.ConditionSeverityInfo, "message") Expect(ctx.Client.Status().Update(ctx, objCopy)).To(Succeed()) By("Validating that the local object's resource version is behind") @@ -359,10 +359,10 @@ func intgTestsPatch() { Expect(err).NotTo(HaveOccurred()) By("Marking Ready=True") - conditions.MarkTrue(obj, vmopv1.ReadyCondition) + conditions.MarkTrue(obj, vmopv1a1.ReadyCondition) By("Patching the object") - Expect(patcher.Patch(ctx, obj, WithOwnedConditions{Conditions: []vmopv1.ConditionType{vmopv1.ReadyCondition}})).To(Succeed()) + Expect(patcher.Patch(ctx, obj, WithOwnedConditions{Conditions: []vmopv1a1.ConditionType{vmopv1a1.ReadyCondition}})).To(Succeed()) By("Validating the object has been updated") Eventually(func() bool { @@ -371,8 +371,8 @@ func intgTestsPatch() { return false } - readyBefore := conditions.Get(obj, vmopv1.ReadyCondition) - readyAfter := conditions.Get(objAfter, vmopv1.ReadyCondition) + readyBefore := conditions.Get(obj, vmopv1a1.ReadyCondition) + readyAfter := conditions.Get(objAfter, vmopv1a1.ReadyCondition) return cmp.Equal(readyBefore, readyAfter) }, timeout).Should(BeTrue()) @@ -390,7 +390,7 @@ func intgTestsPatch() { objCopy := obj.DeepCopy() By("Marking a custom condition to be false") - conditions.MarkFalse(objCopy, vmopv1.ReadyCondition, "reason", vmopv1.ConditionSeverityInfo, "message") + conditions.MarkFalse(objCopy, vmopv1a1.ReadyCondition, "reason", vmopv1a1.ConditionSeverityInfo, "message") Expect(ctx.Client.Status().Update(ctx, objCopy)).To(Succeed()) By("Validating that the local object's resource version is behind") @@ -401,7 +401,7 @@ func intgTestsPatch() { Expect(err).NotTo(HaveOccurred()) By("Marking Ready=True") - conditions.MarkTrue(obj, vmopv1.ReadyCondition) + conditions.MarkTrue(obj, vmopv1a1.ReadyCondition) By("Patching the object") Expect(patcher.Patch(ctx, obj, WithForceOverwriteConditions{})).To(Succeed()) @@ -413,8 +413,8 @@ func intgTestsPatch() { return false } - readyBefore := conditions.Get(obj, vmopv1.ReadyCondition) - readyAfter := conditions.Get(objAfter, vmopv1.ReadyCondition) + readyBefore := conditions.Get(obj, vmopv1a1.ReadyCondition) + readyAfter := conditions.Get(objAfter, vmopv1a1.ReadyCondition) return cmp.Equal(readyBefore, readyAfter) }, timeout).Should(BeTrue()) @@ -423,18 +423,18 @@ func intgTestsPatch() { }) Describe("Should patch a vmopv1.VirtualMachine", func() { - var obj *vmopv1.VirtualMachine + var obj *vmopv1a1.VirtualMachine BeforeEach(func() { - obj = &vmopv1.VirtualMachine{ + obj = &vmopv1a1.VirtualMachine{ ObjectMeta: metav1.ObjectMeta{ GenerateName: "test-", Namespace: ctx.Namespace, }, - Spec: vmopv1.VirtualMachineSpec{ - PowerState: vmopv1.VirtualMachinePoweredOn, + Spec: vmopv1a1.VirtualMachineSpec{ + PowerState: vmopv1a1.VirtualMachinePoweredOn, }, - Status: vmopv1.VirtualMachineStatus{ + Status: vmopv1a1.VirtualMachineStatus{ BiosUUID: "bios-uuid-foo", InstanceUUID: "instance-uuid-foo", UniqueID: "unique-id", @@ -592,7 +592,7 @@ func intgTestsPatch() { obj.Status.Host = "vm-host" By("Setting Ready condition") - conditions.MarkTrue(obj, vmopv1.ReadyCondition) + conditions.MarkTrue(obj, vmopv1a1.ReadyCondition) By("Patching the object") Expect(patcher.Patch(ctx, obj)).To(Succeed()) @@ -605,7 +605,7 @@ func intgTestsPatch() { } return obj.Status.Host == objAfter.Status.Host && - conditions.IsTrue(objAfter, vmopv1.ReadyCondition) && + conditions.IsTrue(objAfter, vmopv1a1.ReadyCondition) && reflect.DeepEqual(obj.Spec, objAfter.Spec) }, timeout).Should(BeTrue()) }) diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/utils_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/utils_test.go index 10139937a..c19c3e758 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/utils_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/patch/utils_test.go @@ -23,19 +23,19 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ) func TestToUnstructured(t *testing.T) { t.Run("with a typed object", func(t *testing.T) { g := NewWithT(t) // Test with a typed object. - obj := &vmopv1.VirtualMachine{ + obj := &vmopv1a1.VirtualMachine{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster-1", Namespace: "namespace-1", }, - Spec: vmopv1.VirtualMachineSpec{ + Spec: vmopv1a1.VirtualMachineSpec{ ImageName: "foo", }, } diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_controller.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_controller.go index 61e89770e..bce0c52c1 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_controller.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_controller.go @@ -20,8 +20,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/manager" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1alpha2 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1/patch" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -40,7 +40,7 @@ const ( // AddToManager adds this package's controller to the provided manager. func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) error { var ( - controlledType = &vmopv1.WebConsoleRequest{} + controlledType = &vmopv1a1.WebConsoleRequest{} controlledTypeName = reflect.TypeOf(controlledType).Elem().Name() controllerNameShort = fmt.Sprintf("%s-controller", strings.ToLower(controlledTypeName)) @@ -52,7 +52,7 @@ func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) er mgr.GetClient(), ctrl.Log.WithName("controllers").WithName(controlledTypeName), record.New(mgr.GetEventRecorderFor(controllerNameLong)), - ctx.VMProviderA2, + ctx.VMProvider, ) return ctrl.NewControllerManagedBy(mgr). @@ -66,23 +66,24 @@ func NewReconciler( client client.Client, logger logr.Logger, recorder record.Recorder, - vmProviderA2 vmprovider.VirtualMachineProviderInterfaceA2) *Reconciler { + provider vmprovider.VirtualMachineProviderInterface) *Reconciler { + return &Reconciler{ - Context: ctx, - Client: client, - Logger: logger, - Recorder: recorder, - VMProviderA2: vmProviderA2, + Context: ctx, + Client: client, + Logger: logger, + Recorder: recorder, + VMProvider: provider, } } // Reconciler reconciles a WebConsoleRequest object. type Reconciler struct { client.Client - Context goctx.Context - Logger logr.Logger - Recorder record.Recorder - VMProviderA2 vmprovider.VirtualMachineProviderInterfaceA2 + Context goctx.Context + Logger logr.Logger + Recorder record.Recorder + VMProvider vmprovider.VirtualMachineProviderInterface } // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=webconsolerequests,verbs=get;list;watch;create;update;patch;delete @@ -94,7 +95,7 @@ type Reconciler struct { func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Result, reterr error) { ctx = pkgconfig.JoinContext(ctx, r.Context) - webconsolerequest := &vmopv1.WebConsoleRequest{} + webconsolerequest := &vmopv1a1.WebConsoleRequest{} err := r.Get(ctx, req.NamespacedName, webconsolerequest) if err != nil { return ctrl.Result{}, client.IgnoreNotFound(err) @@ -104,7 +105,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Resu Context: ctx, Logger: ctrl.Log.WithName("WebConsoleRequest").WithValues("name", req.NamespacedName), WebConsoleRequest: webconsolerequest, - VM: &vmopv1.VirtualMachine{}, + VM: &vmopv1a1.VirtualMachine{}, } done, err := r.ReconcileEarlyNormal(webConsoleRequestCtx) @@ -172,12 +173,12 @@ func (r *Reconciler) ReconcileNormal(ctx *context.WebConsoleRequestContext) erro ctx.Logger.Info("Finished reconciling WebConsoleRequest") }() - v1a2VM := &vmopv1alpha2.VirtualMachine{} - if err := ctx.VM.ConvertTo(v1a2VM); err != nil { + v1a3VM := &vmopv1.VirtualMachine{} + if err := ctx.VM.ConvertTo(v1a3VM); err != nil { return errors.Wrapf(err, "failed to convert VM to v1a2") } - ticket, err := r.VMProviderA2.GetVirtualMachineWebMKSTicket(ctx, v1a2VM, ctx.WebConsoleRequest.Spec.PublicKey) + ticket, err := r.VMProvider.GetVirtualMachineWebMKSTicket(ctx, v1a3VM, ctx.WebConsoleRequest.Spec.PublicKey) if err != nil { return errors.Wrapf(err, "failed to get webmksticket") } diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_intg_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_intg_test.go index 682b3412b..3c67edf62 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_intg_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_intg_test.go @@ -15,8 +15,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1alpha2 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" webconsolerequest "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -39,14 +39,14 @@ func intgTestsReconcile() { var ( ctx *builder.IntegrationTestContext - wcr *vmopv1.WebConsoleRequest - vm *vmopv1.VirtualMachine + wcr *vmopv1a1.WebConsoleRequest + vm *vmopv1a1.VirtualMachine proxySvc *corev1.Service v1a2ProviderCalled bool ) - getWebConsoleRequest := func(ctx *builder.IntegrationTestContext, objKey types.NamespacedName) *vmopv1.WebConsoleRequest { - wcr := &vmopv1.WebConsoleRequest{} + getWebConsoleRequest := func(ctx *builder.IntegrationTestContext, objKey types.NamespacedName) *vmopv1a1.WebConsoleRequest { + wcr := &vmopv1a1.WebConsoleRequest{} if err := ctx.Client.Get(ctx, objKey, wcr); err != nil { return nil } @@ -56,25 +56,25 @@ func intgTestsReconcile() { BeforeEach(func() { ctx = suite.NewIntegrationTestContext() - vm = &vmopv1.VirtualMachine{ + vm = &vmopv1a1.VirtualMachine{ ObjectMeta: metav1.ObjectMeta{ Name: "dummy-vm", Namespace: ctx.Namespace, }, - Spec: vmopv1.VirtualMachineSpec{ + Spec: vmopv1a1.VirtualMachineSpec{ ImageName: "dummy-image", - PowerState: vmopv1.VirtualMachinePoweredOn, + PowerState: vmopv1a1.VirtualMachinePoweredOn, }, } _, publicKeyPem := builder.WebConsoleRequestKeyPair() - wcr = &vmopv1.WebConsoleRequest{ + wcr = &vmopv1a1.WebConsoleRequest{ ObjectMeta: metav1.ObjectMeta{ Name: "dummy-wcr", Namespace: ctx.Namespace, }, - Spec: vmopv1.WebConsoleRequestSpec{ + Spec: vmopv1a1.WebConsoleRequestSpec{ VirtualMachineName: vm.Name, PublicKey: publicKeyPem, }, @@ -95,18 +95,18 @@ func intgTestsReconcile() { }, } - intgFakeVMProviderA2.Lock() - intgFakeVMProviderA2.GetVirtualMachineWebMKSTicketFn = func(ctx context.Context, vm *vmopv1alpha2.VirtualMachine, pubKey string) (string, error) { + intgFakeVMProvider.Lock() + intgFakeVMProvider.GetVirtualMachineWebMKSTicketFn = func(ctx context.Context, vm *vmopv1.VirtualMachine, pubKey string) (string, error) { v1a2ProviderCalled = true return v1a2Ticket, nil } - intgFakeVMProviderA2.Unlock() + intgFakeVMProvider.Unlock() }) AfterEach(func() { ctx.AfterEach() ctx = nil - intgFakeVMProviderA2.Reset() + intgFakeVMProvider.Reset() v1a2ProviderCalled = false }) diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_suite_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_suite_test.go index 0dcade056..1062e20c3 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_suite_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_suite_test.go @@ -16,12 +16,12 @@ import ( "github.com/vmware-tanzu/vm-operator/test/builder" ) -var intgFakeVMProviderA2 = providerfake.NewVMProviderA2() +var intgFakeVMProvider = providerfake.NewVMProvider() var suite = builder.NewTestSuiteForController( v1alpha1.AddToManager, func(ctx *ctrlContext.ControllerManagerContext, _ ctrlmgr.Manager) error { - ctx.VMProviderA2 = intgFakeVMProviderA2 + ctx.VMProvider = intgFakeVMProvider return nil }, ) diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_unit_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_unit_test.go index 76209de8d..cf8da1210 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_unit_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_unit_test.go @@ -14,8 +14,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1alpha2 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" webconsolerequest "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" vmopContext "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -38,29 +38,29 @@ func unitTestsReconcile() { const v1a2Ticket = "some-fake-webmksticket-v1a2" var ( - initObjects []client.Object - ctx *builder.UnitTestContextForController - fakeVMProviderA2 *providerfake.VMProviderA2 + initObjects []client.Object + ctx *builder.UnitTestContextForController + fakeVMProvider *providerfake.VMProvider reconciler *webconsolerequest.Reconciler wcrCtx *vmopContext.WebConsoleRequestContext - wcr *vmopv1.WebConsoleRequest - vm *vmopv1.VirtualMachine + wcr *vmopv1a1.WebConsoleRequest + vm *vmopv1a1.VirtualMachine proxySvc *corev1.Service ) BeforeEach(func() { - vm = &vmopv1.VirtualMachine{ + vm = &vmopv1a1.VirtualMachine{ ObjectMeta: metav1.ObjectMeta{ Name: "dummy-vm", }, } - wcr = &vmopv1.WebConsoleRequest{ + wcr = &vmopv1a1.WebConsoleRequest{ ObjectMeta: metav1.ObjectMeta{ Name: "dummy-wcr", }, - Spec: vmopv1.WebConsoleRequestSpec{ + Spec: vmopv1a1.WebConsoleRequestSpec{ VirtualMachineName: vm.Name, PublicKey: "", }, @@ -90,9 +90,9 @@ func unitTestsReconcile() { ctx.Client, ctx.Logger, ctx.Recorder, - ctx.VMProviderA2, + ctx.VMProvider, ) - fakeVMProviderA2 = ctx.VMProviderA2.(*providerfake.VMProviderA2) + fakeVMProvider = ctx.VMProvider.(*providerfake.VMProvider) wcrCtx = &vmopContext.WebConsoleRequestContext{ Context: ctx, @@ -119,14 +119,14 @@ func unitTestsReconcile() { }) JustBeforeEach(func() { - fakeVMProviderA2.GetVirtualMachineWebMKSTicketFn = func(ctx context.Context, vm *vmopv1alpha2.VirtualMachine, pubKey string) (string, error) { + fakeVMProvider.GetVirtualMachineWebMKSTicketFn = func(ctx context.Context, vm *vmopv1.VirtualMachine, pubKey string) (string, error) { v1a2ProviderCalled = true return v1a2Ticket, nil } }) AfterEach(func() { - fakeVMProviderA2.Reset() + fakeVMProvider.Reset() v1a2ProviderCalled = false }) diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_controller.go b/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_controller.go index 2075b1d9c..6d70c5996 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_controller.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_controller.go @@ -20,7 +20,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/manager" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/patch" @@ -51,7 +51,7 @@ func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) er mgr.GetClient(), ctrl.Log.WithName("controllers").WithName(controlledTypeName), record.New(mgr.GetEventRecorderFor(controllerNameLong)), - ctx.VMProviderA2, + ctx.VMProvider, ) return ctrl.NewControllerManagedBy(mgr). @@ -65,7 +65,7 @@ func NewReconciler( client client.Client, logger logr.Logger, recorder record.Recorder, - vmProvider vmprovider.VirtualMachineProviderInterfaceA2) *Reconciler { + vmProvider vmprovider.VirtualMachineProviderInterface) *Reconciler { return &Reconciler{ Context: ctx, Client: client, @@ -81,7 +81,7 @@ type Reconciler struct { Context goctx.Context Logger logr.Logger Recorder record.Recorder - VMProvider vmprovider.VirtualMachineProviderInterfaceA2 + VMProvider vmprovider.VirtualMachineProviderInterface } // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachinewebconsolerequests,verbs=get;list;watch;create;update;patch;delete @@ -99,7 +99,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Resu return ctrl.Result{}, client.IgnoreNotFound(err) } - webConsoleRequestCtx := &context.WebConsoleRequestContextA2{ + webConsoleRequestCtx := &context.WebConsoleRequestContextV1{ Context: ctx, Logger: ctrl.Log.WithName("WebConsoleRequest").WithValues("name", req.NamespacedName), WebConsoleRequest: webconsolerequest, @@ -143,7 +143,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, req ctrl.Request) (_ ctrl.Resu return ctrl.Result{Requeue: true, RequeueAfter: DefaultExpiryTime}, nil } -func (r *Reconciler) ReconcileEarlyNormal(ctx *context.WebConsoleRequestContextA2) (bool, error) { +func (r *Reconciler) ReconcileEarlyNormal(ctx *context.WebConsoleRequestContextV1) (bool, error) { expiryTime := ctx.WebConsoleRequest.Status.ExpiryTime nowTime := metav1.Now() if !expiryTime.IsZero() && !nowTime.Before(&expiryTime) { @@ -165,7 +165,7 @@ func (r *Reconciler) ReconcileEarlyNormal(ctx *context.WebConsoleRequestContextA return false, nil } -func (r *Reconciler) ReconcileNormal(ctx *context.WebConsoleRequestContextA2) error { +func (r *Reconciler) ReconcileNormal(ctx *context.WebConsoleRequestContextV1) error { ctx.Logger.Info("Reconciling WebConsoleRequest") defer func() { ctx.Logger.Info("Finished reconciling WebConsoleRequest") @@ -208,7 +208,7 @@ func (r *Reconciler) ReconcileNormal(ctx *context.WebConsoleRequestContextA2) er return nil } -func (r *Reconciler) ReconcileOwnerReferences(ctx *context.WebConsoleRequestContextA2) error { +func (r *Reconciler) ReconcileOwnerReferences(ctx *context.WebConsoleRequestContextV1) error { isController := true ownerRef := metav1.OwnerReference{ APIVersion: ctx.VM.APIVersion, diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_intg_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_intg_test.go index 7243cf520..fe1faf312 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_intg_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_intg_test.go @@ -15,7 +15,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" webconsolerequest "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha2" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -27,7 +27,7 @@ func intgTests() { Label( testlabels.Controller, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), intgTestsReconcile, ) diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_suite_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_suite_test.go index 9d49084e9..cd8f2371a 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_suite_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_suite_test.go @@ -17,13 +17,13 @@ import ( "github.com/vmware-tanzu/vm-operator/test/builder" ) -var intgFakeVMProvider = providerfake.NewVMProviderA2() +var intgFakeVMProvider = providerfake.NewVMProvider() var suite = builder.NewTestSuiteForControllerWithContext( pkgconfig.NewContextWithDefaultConfig(), v1alpha2.AddToManager, func(ctx *ctrlContext.ControllerManagerContext, _ ctrlmgr.Manager) error { - ctx.VMProviderA2 = intgFakeVMProvider + ctx.VMProvider = intgFakeVMProvider return nil }) diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_unit_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_unit_test.go index 3202b8a1f..9b8848d58 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_unit_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_unit_test.go @@ -14,7 +14,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" webconsolerequest "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha2" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" vmopContext "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -35,10 +35,10 @@ func unitTestsReconcile() { var ( initObjects []client.Object ctx *builder.UnitTestContextForController - fakeVMProvider *providerfake.VMProviderA2 + fakeVMProvider *providerfake.VMProvider reconciler *webconsolerequest.Reconciler - wcrCtx *vmopContext.WebConsoleRequestContextA2 + wcrCtx *vmopContext.WebConsoleRequestContextV1 wcr *vmopv1.VirtualMachineWebConsoleRequest vm *vmopv1.VirtualMachine proxySvc *corev1.Service @@ -85,11 +85,11 @@ func unitTestsReconcile() { ctx.Client, ctx.Logger, ctx.Recorder, - ctx.VMProviderA2, + ctx.VMProvider, ) - fakeVMProvider = ctx.VMProviderA2.(*providerfake.VMProviderA2) + fakeVMProvider = ctx.VMProvider.(*providerfake.VMProvider) - wcrCtx = &vmopContext.WebConsoleRequestContextA2{ + wcrCtx = &vmopContext.WebConsoleRequestContextV1{ Context: ctx, Logger: ctx.Logger.WithName(wcr.Name), WebConsoleRequest: wcr, diff --git a/controllers/volume/controllers.go b/controllers/volume/controllers.go deleted file mode 100644 index c8db5a69e..000000000 --- a/controllers/volume/controllers.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package volume - -import ( - "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/vmware-tanzu/vm-operator/controllers/volume/v1alpha2" - "github.com/vmware-tanzu/vm-operator/pkg/context" -) - -// AddToManager adds the controller to the provided manager. -func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) error { - return v1alpha2.AddToManager(ctx, mgr) -} diff --git a/controllers/volume/v1alpha2/volume_controller.go b/controllers/volume/volume_controller.go similarity index 96% rename from controllers/volume/v1alpha2/volume_controller.go rename to controllers/volume/volume_controller.go index fceb21c53..3d128cecf 100644 --- a/controllers/volume/v1alpha2/volume_controller.go +++ b/controllers/volume/volume_controller.go @@ -1,7 +1,7 @@ -// Copyright (c) 2019-2021 VMware, Inc. All Rights Reserved. +// Copyright (c) 2019-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2 +package volume import ( goctx "context" @@ -31,7 +31,7 @@ import ( cnsv1alpha1 "github.com/vmware-tanzu/vm-operator/external/vsphere-csi-driver/pkg/syncer/cnsoperator/apis/cnsnodevmattachment/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" pkgmgr "github.com/vmware-tanzu/vm-operator/pkg/manager" @@ -39,8 +39,8 @@ import ( "github.com/vmware-tanzu/vm-operator/pkg/record" "github.com/vmware-tanzu/vm-operator/pkg/util" "github.com/vmware-tanzu/vm-operator/pkg/vmprovider" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/instancestorage" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/instancestorage" ) const ( @@ -71,7 +71,7 @@ func AddToManager(ctx *context.ControllerManagerContext, mgr manager.Manager) er mgr.GetClient(), ctrl.Log.WithName("controllers").WithName("volume"), record.New(mgr.GetEventRecorderFor(controllerNameLong)), - ctx.VMProviderA2, + ctx.VMProvider, ) c, err := controller.New(controllerName, mgr, controller.Options{ @@ -164,7 +164,7 @@ func NewReconciler( client client.Client, logger logr.Logger, recorder record.Recorder, - vmProvider vmprovider.VirtualMachineProviderInterfaceA2) *Reconciler { + vmProvider vmprovider.VirtualMachineProviderInterface) *Reconciler { return &Reconciler{ Context: ctx, Client: client, @@ -181,7 +181,7 @@ type Reconciler struct { Context goctx.Context logger logr.Logger recorder record.Recorder - VMProvider vmprovider.VirtualMachineProviderInterfaceA2 + VMProvider vmprovider.VirtualMachineProviderInterface // The instance storage PVC cache and watch are deferred until actually required. GetInstanceStoragePVCClient func() (client.Reader, error) @@ -211,7 +211,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, request ctrl.Request) (_ ctrl. return reconcile.Result{}, err } - volCtx := &context.VolumeContextA2{ + volCtx := &context.VolumeContext{ Context: ctx, Logger: ctrl.Log.WithName("Volumes").WithValues("name", vm.NamespacedName()), VM: vm, @@ -249,7 +249,7 @@ func (r *Reconciler) Reconcile(ctx goctx.Context, request ctrl.Request) (_ ctrl. return r.reconcileResult(volCtx), nil } -func (r *Reconciler) reconcileResult(ctx *context.VolumeContextA2) ctrl.Result { +func (r *Reconciler) reconcileResult(ctx *context.VolumeContext) ctrl.Result { if pkgconfig.FromContext(ctx).Features.InstanceStorage { // Requeue the request if all instance storage PVCs are not bound. _, pvcsBound := ctx.VM.Annotations[constants.InstanceStoragePVCsBoundAnnotationKey] @@ -264,7 +264,7 @@ func (r *Reconciler) reconcileResult(ctx *context.VolumeContextA2) ctrl.Result { return ctrl.Result{} } -func (r *Reconciler) ReconcileDelete(_ *context.VolumeContextA2) error { +func (r *Reconciler) ReconcileDelete(_ *context.VolumeContext) error { // Do nothing here since we depend on the Garbage Collector to do the deletion of the // dependent CNSNodeVMAttachment objects when their owning VM is deleted. // We require the Volume provider to handle the situation where the VM is deleted before @@ -272,7 +272,7 @@ func (r *Reconciler) ReconcileDelete(_ *context.VolumeContextA2) error { return nil } -func (r *Reconciler) ReconcileNormal(ctx *context.VolumeContextA2) error { +func (r *Reconciler) ReconcileNormal(ctx *context.VolumeContext) error { ctx.Logger.Info("Reconciling VirtualMachine for processing volumes") defer func() { ctx.Logger.Info("Finished Reconciling VirtualMachine for processing volumes") @@ -317,7 +317,7 @@ func (r *Reconciler) ReconcileNormal(ctx *context.VolumeContextA2) error { return k8serrors.NewAggregate([]error{deleteErr, processErr}) } -func (r *Reconciler) reconcileInstanceStoragePVCs(ctx *context.VolumeContextA2) (bool, error) { +func (r *Reconciler) reconcileInstanceStoragePVCs(ctx *context.VolumeContext) (bool, error) { // NOTE: We could check for InstanceStoragePVCsBoundAnnotationKey here and short circuit // all of this. Might leave stale PVCs though. Need to think more: instance storage is // this odd quasi reconcilable thing. @@ -445,7 +445,7 @@ func instanceStoragePVCFailed(ctx goctx.Context, pvc *corev1.PersistentVolumeCla } func (r *Reconciler) instanceStoragePlacementFailed( - ctx *context.VolumeContextA2, + ctx *context.VolumeContext, failedVolumesMap map[string]struct{}) error { // Tell the VM controller that it needs to compute placement again. @@ -462,7 +462,7 @@ func (r *Reconciler) instanceStoragePlacementFailed( } func (r *Reconciler) createMissingInstanceStoragePVCs( - ctx *context.VolumeContextA2, + ctx *context.VolumeContext, isVolumes []vmopv1.VirtualMachineVolume, existingVolumesMap map[string]struct{}, selectedNode string) []error { @@ -479,7 +479,7 @@ func (r *Reconciler) createMissingInstanceStoragePVCs( } func (r *Reconciler) createInstanceStoragePVC( - ctx *context.VolumeContextA2, + ctx *context.VolumeContext, volume vmopv1.VirtualMachineVolume, selectedNode string) error { @@ -523,7 +523,7 @@ func (r *Reconciler) createInstanceStoragePVC( } func (r *Reconciler) getInstanceStoragePVCs( - ctx *context.VolumeContextA2, + ctx *context.VolumeContext, pvcReader client.Reader, volumes []vmopv1.VirtualMachineVolume) ([]corev1.PersistentVolumeClaim, []error) { @@ -550,7 +550,7 @@ func (r *Reconciler) getInstanceStoragePVCs( } func (r *Reconciler) deleteInstanceStoragePVCs( - ctx *context.VolumeContextA2, + ctx *context.VolumeContext, objKeys []client.ObjectKey) []error { var errs []error @@ -572,7 +572,7 @@ func (r *Reconciler) deleteInstanceStoragePVCs( } // Return the existing CnsNodeVmAttachments that are for this VM. -func (r *Reconciler) getAttachmentsForVM(ctx *context.VolumeContextA2) (map[string]cnsv1alpha1.CnsNodeVmAttachment, error) { +func (r *Reconciler) getAttachmentsForVM(ctx *context.VolumeContext) (map[string]cnsv1alpha1.CnsNodeVmAttachment, error) { // We need to filter the attachments for the ones for this VM. There are a few ways we can do this: // - Look at the OwnerRefs for this VM. Note that we'd need to compare by the UUID, not the name, // to handle the situation we the VM is deleted and recreated before the GC deletes any prior @@ -599,7 +599,7 @@ func (r *Reconciler) getAttachmentsForVM(ctx *context.VolumeContextA2) (map[stri } func (r *Reconciler) processAttachments( - ctx *context.VolumeContextA2, + ctx *context.VolumeContext, attachments map[string]cnsv1alpha1.CnsNodeVmAttachment, orphanedAttachments []cnsv1alpha1.CnsNodeVmAttachment) error { @@ -707,7 +707,7 @@ func (r *Reconciler) processAttachments( } func (r *Reconciler) createCNSAttachment( - ctx *context.VolumeContextA2, + ctx *context.VolumeContext, attachmentName string, volume vmopv1.VirtualMachineVolume) error { @@ -746,7 +746,7 @@ func (r *Reconciler) createCNSAttachment( // it instead - clearing Attached atomically since it doesn't have a Status subresource - but it // should not be treating the Status as the SoT. func (r *Reconciler) createCNSAttachmentButAlreadyExists( - ctx *context.VolumeContextA2, + ctx *context.VolumeContext, attachmentName string) error { attachment := &cnsv1alpha1.CnsNodeVmAttachment{} @@ -793,7 +793,7 @@ func (r *Reconciler) createCNSAttachmentButAlreadyExists( // This is a hack to preserve the prior behavior of including detach(ing) volumes that were // removed from the Spec in the Status until they are actually deleted. func (r *Reconciler) preserveOrphanedAttachmentStatus( - ctx *context.VolumeContextA2, + ctx *context.VolumeContext, orphanedAttachments []cnsv1alpha1.CnsNodeVmAttachment) []vmopv1.VirtualMachineVolumeStatus { uuidAttachments := make(map[string]cnsv1alpha1.CnsNodeVmAttachment, len(orphanedAttachments)) @@ -818,7 +818,7 @@ func (r *Reconciler) preserveOrphanedAttachmentStatus( } func (r *Reconciler) attachmentsToDelete( - ctx *context.VolumeContextA2, + ctx *context.VolumeContext, attachments map[string]cnsv1alpha1.CnsNodeVmAttachment) []cnsv1alpha1.CnsNodeVmAttachment { expectedAttachments := make(map[string]string, len(ctx.VM.Spec.Volumes)) @@ -842,7 +842,7 @@ func (r *Reconciler) attachmentsToDelete( return attachmentsToDelete } -func (r *Reconciler) deleteOrphanedAttachments(ctx *context.VolumeContextA2, attachments []cnsv1alpha1.CnsNodeVmAttachment) error { +func (r *Reconciler) deleteOrphanedAttachments(ctx *context.VolumeContext, attachments []cnsv1alpha1.CnsNodeVmAttachment) error { var errs []error for i := range attachments { diff --git a/controllers/volume/v1alpha2/volume_controller_intg_test.go b/controllers/volume/volume_controller_intg_test.go similarity index 98% rename from controllers/volume/v1alpha2/volume_controller_intg_test.go rename to controllers/volume/volume_controller_intg_test.go index 6742f07d3..419b40c66 100644 --- a/controllers/volume/v1alpha2/volume_controller_intg_test.go +++ b/controllers/volume/volume_controller_intg_test.go @@ -1,7 +1,7 @@ -// Copyright (c) 2020 VMware, Inc. All Rights Reserved. +// Copyright (c) 2020-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package volume_test import ( "fmt" @@ -19,14 +19,14 @@ import ( cnsv1alpha1 "github.com/vmware-tanzu/vm-operator/external/vsphere-csi-driver/pkg/syncer/cnsoperator/apis/cnsnodevmattachment/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - volume "github.com/vmware-tanzu/vm-operator/controllers/volume/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/controllers/volume" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/pkg/patch" "github.com/vmware-tanzu/vm-operator/pkg/util" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/instancestorage" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/instancestorage" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -36,7 +36,7 @@ func intgTests() { Label( testlabels.Controller, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), intgTestsReconcile, ) diff --git a/controllers/volume/v1alpha2/volume_controller_suite_test.go b/controllers/volume/volume_controller_suite_test.go similarity index 76% rename from controllers/volume/v1alpha2/volume_controller_suite_test.go rename to controllers/volume/volume_controller_suite_test.go index 53daf051b..135db3546 100644 --- a/controllers/volume/v1alpha2/volume_controller_suite_test.go +++ b/controllers/volume/volume_controller_suite_test.go @@ -1,7 +1,7 @@ -// Copyright (c) 2020 VMware, Inc. All Rights Reserved. +// Copyright (c) 2020-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package volume_test import ( "testing" @@ -10,20 +10,20 @@ import ( ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" - volume "github.com/vmware-tanzu/vm-operator/controllers/volume/v1alpha2" + "github.com/vmware-tanzu/vm-operator/controllers/volume" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" ctrlContext "github.com/vmware-tanzu/vm-operator/pkg/context" providerfake "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/fake" "github.com/vmware-tanzu/vm-operator/test/builder" ) -var intgFakeVMProvider = providerfake.NewVMProviderA2() +var intgFakeVMProvider = providerfake.NewVMProvider() var suite = builder.NewTestSuiteForControllerWithContext( pkgconfig.NewContextWithDefaultConfig(), volume.AddToManager, func(ctx *ctrlContext.ControllerManagerContext, _ ctrlmgr.Manager) error { - ctx.VMProviderA2 = intgFakeVMProvider + ctx.VMProvider = intgFakeVMProvider return nil }) diff --git a/controllers/volume/v1alpha2/volume_controller_unit_test.go b/controllers/volume/volume_controller_unit_test.go similarity index 97% rename from controllers/volume/v1alpha2/volume_controller_unit_test.go rename to controllers/volume/volume_controller_unit_test.go index beab02a12..01f454cb8 100644 --- a/controllers/volume/v1alpha2/volume_controller_unit_test.go +++ b/controllers/volume/volume_controller_unit_test.go @@ -1,7 +1,7 @@ -// Copyright (c) 2020-2021 VMware, Inc. All Rights Reserved. +// Copyright (c) 2020-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -package v1alpha2_test +package volume_test import ( goctx "context" @@ -23,15 +23,15 @@ import ( cnsv1alpha1 "github.com/vmware-tanzu/vm-operator/external/vsphere-csi-driver/pkg/syncer/cnsoperator/apis/cnsnodevmattachment/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - volume "github.com/vmware-tanzu/vm-operator/controllers/volume/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/controllers/volume" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" volContext "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/util" providerfake "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/fake" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/instancestorage" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/instancestorage" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -67,7 +67,7 @@ func unitTests() { "Reconcile", Label( testlabels.Controller, - testlabels.V1Alpha2, + testlabels.V1Alpha3, ), unitTestsReconcile, ) @@ -86,8 +86,8 @@ func unitTestsReconcile() { instanceStorageTest bool reconciler *volume.Reconciler - fakeVMProvider *providerfake.VMProviderA2 - volCtx *volContext.VolumeContextA2 + fakeVMProvider *providerfake.VMProvider + volCtx *volContext.VolumeContext vm *vmopv1.VirtualMachine vmVol vmopv1.VirtualMachineVolume @@ -171,9 +171,9 @@ func unitTestsReconcile() { noPVCClient, ctx.Logger, ctx.Recorder, - ctx.VMProviderA2, + ctx.VMProvider, ) - fakeVMProvider = ctx.VMProviderA2.(*providerfake.VMProviderA2) + fakeVMProvider = ctx.VMProvider.(*providerfake.VMProvider) if instanceStorageTest { pkgconfig.SetContext(ctx, func(config *pkgconfig.Config) { @@ -184,7 +184,7 @@ func unitTestsReconcile() { } } - volCtx = &volContext.VolumeContextA2{ + volCtx = &volContext.VolumeContext{ Context: ctx, Logger: ctx.Logger, VM: vm, @@ -946,7 +946,7 @@ func cnsAttachmentForVMVolume( } } -func expectPVCsStatus(ctx *volContext.VolumeContextA2, testCtx *builder.UnitTestContextForController, selectedNodeSet, bound bool, pvcsCount int) { +func expectPVCsStatus(ctx *volContext.VolumeContext, testCtx *builder.UnitTestContextForController, selectedNodeSet, bound bool, pvcsCount int) { if selectedNodeSet { Expect(ctx.VM.Annotations).To(HaveKey(constants.InstanceStorageSelectedNodeAnnotationKey)) Expect(ctx.VM.Annotations).To(HaveKey(constants.InstanceStorageSelectedNodeMOIDAnnotationKey)) @@ -966,7 +966,7 @@ func expectPVCsStatus(ctx *volContext.VolumeContextA2, testCtx *builder.UnitTest Expect(pvcList).To(HaveLen(pvcsCount)) } -func adjustPVCCreationTimestamp(ctx *volContext.VolumeContextA2, testCtx *builder.UnitTestContextForController) { +func adjustPVCCreationTimestamp(ctx *volContext.VolumeContext, testCtx *builder.UnitTestContextForController) { pvcList, err := getInstanceStoragePVCs(ctx, testCtx) Expect(err).ToNot(HaveOccurred()) @@ -977,7 +977,7 @@ func adjustPVCCreationTimestamp(ctx *volContext.VolumeContextA2, testCtx *builde } } -func getInstanceStoragePVCs(ctx *volContext.VolumeContextA2, testCtx *builder.UnitTestContextForController) ([]corev1.PersistentVolumeClaim, error) { +func getInstanceStoragePVCs(ctx *volContext.VolumeContext, testCtx *builder.UnitTestContextForController) ([]corev1.PersistentVolumeClaim, error) { var errs []error pvcList := make([]corev1.PersistentVolumeClaim, 0) @@ -1003,7 +1003,7 @@ func getInstanceStoragePVCs(ctx *volContext.VolumeContextA2, testCtx *builder.Un return pvcList, k8serrors.NewAggregate(errs) } -func patchInstanceStoragePVCs(ctx *volContext.VolumeContextA2, testCtx *builder.UnitTestContextForController, setStatusBound, setErrorAnnotation bool) { +func patchInstanceStoragePVCs(ctx *volContext.VolumeContext, testCtx *builder.UnitTestContextForController, setStatusBound, setErrorAnnotation bool) { pvcList, err := getInstanceStoragePVCs(ctx, testCtx) Expect(err).ToNot(HaveOccurred()) diff --git a/docs/start/contrib/submit-change.md b/docs/start/contrib/submit-change.md index 8b0aca00f..5c0e6d49f 100644 --- a/docs/start/contrib/submit-change.md +++ b/docs/start/contrib/submit-change.md @@ -106,10 +106,10 @@ The above command searches for any use of constant from the `pkg/constants/testl ```shell ./controllers/volume/v1alpha2/volume_controller_unit_test.go:50:testlabels.Controller -./controllers/volume/v1alpha2/volume_controller_unit_test.go:51:testlabels.V1Alpha2 +./controllers/volume/v1alpha2/volume_controller_unit_test.go:51:testlabels.V1Alpha3 ./controllers/volume/v1alpha2/volume_controller_intg_test.go:37:testlabels.Controller ./controllers/volume/v1alpha2/volume_controller_intg_test.go:38:testlabels.EnvTest -./controllers/volume/v1alpha2/volume_controller_intg_test.go:39:testlabels.V1Alpha2 +./controllers/volume/v1alpha2/volume_controller_intg_test.go:39:testlabels.V1Alpha3 ./pkg/util/vsphere/vm/suite_test.go:16:testlabels.VCSim ./pkg/util/vsphere/vm/suite_test.go:17:testlabels.VCSim ./pkg/util/vsphere/client/client_test.go:34:testlabels.VCSim diff --git a/hack/boilerplate/boilerplate.generatego.txt b/hack/boilerplate/boilerplate.generatego.txt index e516daea9..902565cab 100644 --- a/hack/boilerplate/boilerplate.generatego.txt +++ b/hack/boilerplate/boilerplate.generatego.txt @@ -1,2 +1,2 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 diff --git a/pkg/conditions/getter.go b/pkg/conditions/getter.go index fe5a554d4..e2898670b 100644 --- a/pkg/conditions/getter.go +++ b/pkg/conditions/getter.go @@ -20,7 +20,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - vmop "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) const ( @@ -130,7 +130,7 @@ func summary(from Getter, options ...MergeOption) *metav1.Condition { conditionsInScope := make([]localizedCondition, 0, len(conditions)) for i := range conditions { c := conditions[i] - if c.Type == vmop.ReadyConditionType { + if c.Type == vmopv1.ReadyConditionType { continue } @@ -183,7 +183,7 @@ func summary(from Getter, options ...MergeOption) *metav1.Condition { } } - return merge(conditionsInScope, vmop.ReadyConditionType, mergeOpt) + return merge(conditionsInScope, vmopv1.ReadyConditionType, mergeOpt) } // mirrorOptions allows to set options for the mirror operation. @@ -214,7 +214,7 @@ func mirror(from Getter, targetCondition string, options ...MirrorOptions) *meta o(mirrorOpt) } - condition := Get(from, vmop.ReadyConditionType) + condition := Get(from, vmopv1.ReadyConditionType) if mirrorOpt.fallbackTo != nil && condition == nil { switch *mirrorOpt.fallbackTo { @@ -238,7 +238,7 @@ func mirror(from Getter, targetCondition string, options ...MirrorOptions) *meta func aggregate(from []Getter, targetCondition string, options ...MergeOption) *metav1.Condition { conditionsInScope := make([]localizedCondition, 0, len(from)) for i := range from { - condition := Get(from[i], vmop.ReadyConditionType) + condition := Get(from[i], vmopv1.ReadyConditionType) conditionsInScope = append(conditionsInScope, localizedCondition{ Condition: condition, diff --git a/pkg/conditions/getter_test.go b/pkg/conditions/getter_test.go index 7ba69b2f8..de2eb07df 100644 --- a/pkg/conditions/getter_test.go +++ b/pkg/conditions/getter_test.go @@ -26,7 +26,7 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) var ( diff --git a/pkg/conditions/merge_strategies_test.go b/pkg/conditions/merge_strategies_test.go index e11c1df72..26696ba7b 100644 --- a/pkg/conditions/merge_strategies_test.go +++ b/pkg/conditions/merge_strategies_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) func TestGetStepCounterMessage(t *testing.T) { diff --git a/pkg/conditions/merge_test.go b/pkg/conditions/merge_test.go index 4a9cd106a..101e58037 100644 --- a/pkg/conditions/merge_test.go +++ b/pkg/conditions/merge_test.go @@ -23,7 +23,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) func TestNewConditionsGroup(t *testing.T) { diff --git a/pkg/conditions/patch_test.go b/pkg/conditions/patch_test.go index e57aff34b..327dc469c 100644 --- a/pkg/conditions/patch_test.go +++ b/pkg/conditions/patch_test.go @@ -24,7 +24,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) func TestNewPatch(t *testing.T) { diff --git a/pkg/conditions/setter_test.go b/pkg/conditions/setter_test.go index 7b61a6fa7..21320b9e6 100644 --- a/pkg/conditions/setter_test.go +++ b/pkg/conditions/setter_test.go @@ -27,7 +27,7 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) func TestHasSameState(t *testing.T) { diff --git a/pkg/conditions/unstructured_test.go b/pkg/conditions/unstructured_test.go index 89a7f873f..86308ee58 100644 --- a/pkg/conditions/unstructured_test.go +++ b/pkg/conditions/unstructured_test.go @@ -25,7 +25,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) func TestUnstructuredGetConditions(t *testing.T) { diff --git a/pkg/constants/testlabels/test_labels.go b/pkg/constants/testlabels/test_labels.go index 7810502ff..6e322cff8 100644 --- a/pkg/constants/testlabels/test_labels.go +++ b/pkg/constants/testlabels/test_labels.go @@ -37,8 +37,8 @@ const ( // V1Alpha1 describes a test related to the v1alpha1 APIs. V1Alpha1 = "v1alpha1" - // V1Alpha2 describes a test related to the v1alpha2 APIS. - V1Alpha2 = "v1alpha2" + // V1Alpha3 describes a test related to the v1alpha3 APIS. + V1Alpha3 = "v1alpha3" // VCSim describes a test that uses vC Sim. VCSim = "vcsim" diff --git a/pkg/context/clustercontentlibraryitem_context.go b/pkg/context/clustercontentlibraryitem_context.go index 455db3c2a..2a9538476 100644 --- a/pkg/context/clustercontentlibraryitem_context.go +++ b/pkg/context/clustercontentlibraryitem_context.go @@ -10,25 +10,11 @@ import ( "github.com/go-logr/logr" imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) // ClusterContentLibraryItemContext is the context used for ClusterContentLibraryItem controller. type ClusterContentLibraryItemContext struct { - context.Context - Logger logr.Logger - CCLItem *imgregv1a1.ClusterContentLibraryItem - CVMI *v1alpha1.ClusterVirtualMachineImage - ImageObjName string -} - -func (c *ClusterContentLibraryItemContext) String() string { - return fmt.Sprintf("%s %s", c.CCLItem.GroupVersionKind(), c.CCLItem.Name) -} - -// ClusterContentLibraryItemContextA2 is the context used for ClusterContentLibraryItem controller. -type ClusterContentLibraryItemContextA2 struct { context.Context Logger logr.Logger CCLItem *imgregv1a1.ClusterContentLibraryItem @@ -36,6 +22,6 @@ type ClusterContentLibraryItemContextA2 struct { ImageObjName string } -func (c *ClusterContentLibraryItemContextA2) String() string { +func (c *ClusterContentLibraryItemContext) String() string { return fmt.Sprintf("%s %s", c.CCLItem.GroupVersionKind(), c.CCLItem.Name) } diff --git a/pkg/context/contentlibraryitem_context.go b/pkg/context/contentlibraryitem_context.go index da4cf4961..180ce8c57 100644 --- a/pkg/context/contentlibraryitem_context.go +++ b/pkg/context/contentlibraryitem_context.go @@ -11,25 +11,11 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) // ContentLibraryItemContext is the context used for ContentLibraryItem controller. type ContentLibraryItemContext struct { - context.Context - Logger logr.Logger - CLItem *imgregv1a1.ContentLibraryItem - VMI *v1alpha1.VirtualMachineImage - ImageObjName string -} - -func (c *ContentLibraryItemContext) String() string { - return fmt.Sprintf("%s %s/%s", c.CLItem.GroupVersionKind(), c.CLItem.Namespace, c.CLItem.Name) -} - -// ContentLibraryItemContextA2 is the context used for ContentLibraryItem controller. -type ContentLibraryItemContextA2 struct { context.Context Logger logr.Logger CLItem *imgregv1a1.ContentLibraryItem @@ -37,6 +23,6 @@ type ContentLibraryItemContextA2 struct { ImageObjName string } -func (c *ContentLibraryItemContextA2) String() string { +func (c *ContentLibraryItemContext) String() string { return fmt.Sprintf("%s %s/%s", c.CLItem.GroupVersionKind(), c.CLItem.Namespace, c.CLItem.Name) } diff --git a/pkg/context/controller_manager_context.go b/pkg/context/controller_manager_context.go index 125849f6b..0a1e9fcef 100644 --- a/pkg/context/controller_manager_context.go +++ b/pkg/context/controller_manager_context.go @@ -72,8 +72,8 @@ type ControllerManagerContext struct { // responsiveness to change if there are many watched resources. SyncPeriod time.Duration - // VMProviderA2 is the controller manager's VM Provider for v1alpha2 - VMProviderA2 vmprovider.VirtualMachineProviderInterfaceA2 + // VMProvider is the controller manager's VM Provider. + VMProvider vmprovider.VirtualMachineProviderInterface } // String returns ControllerManagerName. diff --git a/pkg/context/fake/fake_controller_manager_context.go b/pkg/context/fake/fake_controller_manager_context.go index 62c2db6d3..93fa10dc7 100644 --- a/pkg/context/fake/fake_controller_manager_context.go +++ b/pkg/context/fake/fake_controller_manager_context.go @@ -25,6 +25,6 @@ func NewControllerManagerContext() *context.ControllerManagerContext { LeaderElectionNamespace: LeaderElectionNamespace, LeaderElectionID: LeaderElectionID, Recorder: record.New(clientrecord.NewFakeRecorder(1024)), - VMProviderA2: providerfake.NewVMProviderA2(), + VMProvider: providerfake.NewVMProvider(), } } diff --git a/pkg/context/virtualmachine_context.go b/pkg/context/virtualmachine_context.go index 65d024dcf..7149328dd 100644 --- a/pkg/context/virtualmachine_context.go +++ b/pkg/context/virtualmachine_context.go @@ -9,28 +9,16 @@ import ( "github.com/go-logr/logr" - "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) // VirtualMachineContext is the context used for VirtualMachineControllers. type VirtualMachineContext struct { - context.Context - Logger logr.Logger - VM *v1alpha1.VirtualMachine -} - -func (v *VirtualMachineContext) String() string { - return fmt.Sprintf("%s %s/%s", v.VM.GroupVersionKind(), v.VM.Namespace, v.VM.Name) -} - -// VirtualMachineContextA2 is the context used for VirtualMachineControllers. -type VirtualMachineContextA2 struct { context.Context Logger logr.Logger VM *vmopv1.VirtualMachine } -func (v *VirtualMachineContextA2) String() string { +func (v *VirtualMachineContext) String() string { return fmt.Sprintf("%s %s/%s", v.VM.GroupVersionKind(), v.VM.Namespace, v.VM.Name) } diff --git a/pkg/context/virtualmachineclass_context.go b/pkg/context/virtualmachineclass_context.go index a34003589..d53348d41 100644 --- a/pkg/context/virtualmachineclass_context.go +++ b/pkg/context/virtualmachineclass_context.go @@ -9,28 +9,16 @@ import ( "github.com/go-logr/logr" - "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) // VirtualMachineClassContext is the context used for VirtualMachineClassControllers. type VirtualMachineClassContext struct { - context.Context - Logger logr.Logger - VMClass *v1alpha1.VirtualMachineClass -} - -func (v *VirtualMachineClassContext) String() string { - return fmt.Sprintf("%s %s/%s", v.VMClass.GroupVersionKind(), v.VMClass.Namespace, v.VMClass.Name) -} - -// VirtualMachineClassContextA2 is the context used for VirtualMachineClassControllers. -type VirtualMachineClassContextA2 struct { context.Context Logger logr.Logger VMClass *vmopv1.VirtualMachineClass } -func (v *VirtualMachineClassContextA2) String() string { +func (v *VirtualMachineClassContext) String() string { return fmt.Sprintf("%s %s/%s", v.VMClass.GroupVersionKind(), v.VMClass.Namespace, v.VMClass.Name) } diff --git a/pkg/context/virtualmachinepublishrequest_context.go b/pkg/context/virtualmachinepublishrequest_context.go index a3eff25ac..ea5898f0e 100644 --- a/pkg/context/virtualmachinepublishrequest_context.go +++ b/pkg/context/virtualmachinepublishrequest_context.go @@ -11,29 +11,11 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) // VirtualMachinePublishRequestContext is the context used for VirtualMachinePublishRequestControllers. type VirtualMachinePublishRequestContext struct { - context.Context - Logger logr.Logger - VMPublishRequest *v1alpha1.VirtualMachinePublishRequest - VM *v1alpha1.VirtualMachine - ContentLibrary *imgregv1a1.ContentLibrary - ItemID string - // SkipPatch indicates whether we should skip patching the object after reconcile - // because Status is updated separately in the publishing case due to CL API limitations. - SkipPatch bool -} - -func (v *VirtualMachinePublishRequestContext) String() string { - return fmt.Sprintf("%s %s/%s", v.VMPublishRequest.GroupVersionKind(), v.VMPublishRequest.Namespace, v.VMPublishRequest.Name) -} - -// VirtualMachinePublishRequestContextA2 is the context used for VirtualMachinePublishRequestControllers. -type VirtualMachinePublishRequestContextA2 struct { context.Context Logger logr.Logger VMPublishRequest *vmopv1.VirtualMachinePublishRequest @@ -45,6 +27,6 @@ type VirtualMachinePublishRequestContextA2 struct { SkipPatch bool } -func (v *VirtualMachinePublishRequestContextA2) String() string { +func (v *VirtualMachinePublishRequestContext) String() string { return fmt.Sprintf("%s %s/%s", v.VMPublishRequest.GroupVersionKind(), v.VMPublishRequest.Namespace, v.VMPublishRequest.Name) } diff --git a/pkg/context/virtualmachineservice_context.go b/pkg/context/virtualmachineservice_context.go index 8cffe0e6c..5a04ada82 100644 --- a/pkg/context/virtualmachineservice_context.go +++ b/pkg/context/virtualmachineservice_context.go @@ -9,28 +9,16 @@ import ( "github.com/go-logr/logr" - "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) // VirtualMachineServiceContext is the context used for VirtualMachineServiceController. type VirtualMachineServiceContext struct { - context.Context - Logger logr.Logger - VMService *v1alpha1.VirtualMachineService -} - -func (v *VirtualMachineServiceContext) String() string { - return fmt.Sprintf("%s %s/%s", v.VMService.GroupVersionKind(), v.VMService.Namespace, v.VMService.Name) -} - -// VirtualMachineServiceContextA2 is the context used for VirtualMachineServiceController. -type VirtualMachineServiceContextA2 struct { context.Context Logger logr.Logger VMService *vmopv1.VirtualMachineService } -func (v *VirtualMachineServiceContextA2) String() string { +func (v *VirtualMachineServiceContext) String() string { return fmt.Sprintf("%s %s/%s", v.VMService.GroupVersionKind(), v.VMService.Namespace, v.VMService.Name) } diff --git a/pkg/context/virtualmachinesetresourcepolicy_context.go b/pkg/context/virtualmachinesetresourcepolicy_context.go index fb17693d3..026a06451 100644 --- a/pkg/context/virtualmachinesetresourcepolicy_context.go +++ b/pkg/context/virtualmachinesetresourcepolicy_context.go @@ -9,28 +9,16 @@ import ( "github.com/go-logr/logr" - "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) // VirtualMachineSetResourcePolicyContext is the context used for VirtualMachineControllers. type VirtualMachineSetResourcePolicyContext struct { - context.Context - Logger logr.Logger - ResourcePolicy *v1alpha1.VirtualMachineSetResourcePolicy -} - -func (v *VirtualMachineSetResourcePolicyContext) String() string { - return fmt.Sprintf("%s %s/%s", v.ResourcePolicy.GroupVersionKind(), v.ResourcePolicy.Namespace, v.ResourcePolicy.Name) -} - -// VirtualMachineSetResourcePolicyContextA2 is the context used for VirtualMachineControllers. -type VirtualMachineSetResourcePolicyContextA2 struct { context.Context Logger logr.Logger ResourcePolicy *vmopv1.VirtualMachineSetResourcePolicy } -func (v *VirtualMachineSetResourcePolicyContextA2) String() string { +func (v *VirtualMachineSetResourcePolicyContext) String() string { return fmt.Sprintf("%s %s/%s", v.ResourcePolicy.GroupVersionKind(), v.ResourcePolicy.Namespace, v.ResourcePolicy.Name) } diff --git a/pkg/context/volume_context.go b/pkg/context/volume_context.go index 870a3578b..d96895aeb 100644 --- a/pkg/context/volume_context.go +++ b/pkg/context/volume_context.go @@ -9,16 +9,16 @@ import ( "github.com/go-logr/logr" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) -// VolumeContextA2 is the context used for VolumeController. -type VolumeContextA2 struct { +// VolumeContext is the context used for VolumeController. +type VolumeContext struct { context.Context Logger logr.Logger VM *vmopv1.VirtualMachine } -func (v *VolumeContextA2) String() string { +func (v *VolumeContext) String() string { return fmt.Sprintf("%s %s/%s", v.VM.GroupVersionKind(), v.VM.Namespace, v.VM.Name) } diff --git a/pkg/context/webconsolerequest_context.go b/pkg/context/webconsolerequest_context.go index 96a25894c..34ff5374c 100644 --- a/pkg/context/webconsolerequest_context.go +++ b/pkg/context/webconsolerequest_context.go @@ -10,7 +10,7 @@ import ( "github.com/go-logr/logr" "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) // WebConsoleRequestContext is the context used for WebConsoleRequestControllers. @@ -25,14 +25,14 @@ func (v *WebConsoleRequestContext) String() string { return fmt.Sprintf("%s %s/%s", v.WebConsoleRequest.GroupVersionKind(), v.WebConsoleRequest.Namespace, v.WebConsoleRequest.Name) } -// WebConsoleRequestContextA2 is the context used for WebConsoleRequestControllers. -type WebConsoleRequestContextA2 struct { +// WebConsoleRequestContextV1 is the context used for WebConsoleRequestControllers. +type WebConsoleRequestContextV1 struct { context.Context Logger logr.Logger WebConsoleRequest *vmopv1.VirtualMachineWebConsoleRequest VM *vmopv1.VirtualMachine } -func (v *WebConsoleRequestContextA2) String() string { +func (v *WebConsoleRequestContextV1) String() string { return fmt.Sprintf("%s %s/%s", v.WebConsoleRequest.GroupVersionKind(), v.WebConsoleRequest.Namespace, v.WebConsoleRequest.Name) } diff --git a/pkg/manager/init/init_providers.go b/pkg/manager/init/init_providers.go index e14a49a52..50b7e3070 100644 --- a/pkg/manager/init/init_providers.go +++ b/pkg/manager/init/init_providers.go @@ -10,7 +10,7 @@ import ( "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/record" - vsphere2 "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2" + vsphere2 "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere" ) func InitializeProviders( @@ -19,6 +19,6 @@ func InitializeProviders( vmProviderName := fmt.Sprintf("%s/%s/vmProvider", ctx.Namespace, ctx.Name) recorder := record.New(mgr.GetEventRecorderFor(vmProviderName)) - ctx.VMProviderA2 = vsphere2.NewVSphereVMProviderFromClient(ctx, mgr.GetClient(), recorder) + ctx.VMProvider = vsphere2.NewVSphereVMProviderFromClient(ctx, mgr.GetClient(), recorder) return nil } diff --git a/pkg/manager/manager.go b/pkg/manager/manager.go index 0b1925c9b..3669ad7b9 100644 --- a/pkg/manager/manager.go +++ b/pkg/manager/manager.go @@ -27,8 +27,9 @@ import ( topologyv1 "github.com/vmware-tanzu/vm-operator/external/tanzu-topology/api/v1alpha1" cnsv1alpha1 "github.com/vmware-tanzu/vm-operator/external/vsphere-csi-driver/pkg/syncer/cnsoperator/apis" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1alpha2 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a2 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/record" @@ -55,7 +56,9 @@ func New(ctx goctx.Context, opts Options) (Manager, error) { _ = topologyv1.AddToScheme(opts.Scheme) _ = imgregv1a1.AddToScheme(opts.Scheme) - _ = vmopv1alpha2.AddToScheme(opts.Scheme) + _ = vmopv1a1.AddToScheme(opts.Scheme) + _ = vmopv1a2.AddToScheme(opts.Scheme) + _ = vmopv1.AddToScheme(opts.Scheme) if pkgconfig.FromContext(ctx).NetworkProviderType == pkgconfig.NetworkProviderTypeVPC { _ = vpcv1alpha1.AddToScheme(opts.Scheme) diff --git a/pkg/metrics/vmservice_metrics.go b/pkg/metrics/vmservice_metrics.go index 6e52ef24d..80f44ba95 100644 --- a/pkg/metrics/vmservice_metrics.go +++ b/pkg/metrics/vmservice_metrics.go @@ -10,7 +10,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/metrics" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/context" ) @@ -72,7 +72,7 @@ func NewVMMetrics() *VMMetrics { return vmMetrics } -func (vmm *VMMetrics) RegisterVMCreateOrUpdateMetrics(vmCtx *context.VirtualMachineContextA2) { +func (vmm *VMMetrics) RegisterVMCreateOrUpdateMetrics(vmCtx *context.VirtualMachineContext) { vmm.registerVMStatusConditions(vmCtx) vmm.registerVMStatusCreationPhase(vmCtx) vmm.registerVMPowerState(vmCtx) @@ -81,7 +81,7 @@ func (vmm *VMMetrics) RegisterVMCreateOrUpdateMetrics(vmCtx *context.VirtualMach // DeleteMetrics deletes metrics for a specific VM post deletion reconcile. // It is critical to stop reporting metrics for a deleted VM resource. -func (vmm *VMMetrics) DeleteMetrics(vmCtx *context.VirtualMachineContextA2) { +func (vmm *VMMetrics) DeleteMetrics(vmCtx *context.VirtualMachineContext) { vm := vmCtx.VM vmCtx.Logger.V(5).Info("Deleting metrics for VM") @@ -103,7 +103,7 @@ func (vmm *VMMetrics) DeleteMetrics(vmCtx *context.VirtualMachineContextA2) { vmm.statusIP.DeletePartialMatch(labels) } -func (vmm *VMMetrics) registerVMStatusConditions(vmCtx *context.VirtualMachineContextA2) { +func (vmm *VMMetrics) registerVMStatusConditions(vmCtx *context.VirtualMachineContext) { vm := vmCtx.VM vmCtx.Logger.V(5).Info("Adding metrics for VM condition") @@ -135,7 +135,7 @@ func (vmm *VMMetrics) registerVMStatusConditions(vmCtx *context.VirtualMachineCo } } -func (vmm *VMMetrics) registerVMStatusCreationPhase(vmCtx *context.VirtualMachineContextA2) { +func (vmm *VMMetrics) registerVMStatusCreationPhase(vmCtx *context.VirtualMachineContext) { vmCtx.Logger.V(5).Info("Adding metrics for VM status creation phase") vm := vmCtx.VM @@ -168,7 +168,7 @@ func (vmm *VMMetrics) registerVMStatusCreationPhase(vmCtx *context.VirtualMachin vmm.statusPhase.With(newLabels).Set(1) } -func (vmm *VMMetrics) registerVMPowerState(vmCtx *context.VirtualMachineContextA2) { +func (vmm *VMMetrics) registerVMPowerState(vmCtx *context.VirtualMachineContext) { vm := vmCtx.VM vmCtx.Logger.V(5).Info("Adding metrics for VM power state") @@ -188,7 +188,7 @@ func (vmm *VMMetrics) registerVMPowerState(vmCtx *context.VirtualMachineContextA vmm.powerState.With(newLabels).Set(1) } -func (vmm *VMMetrics) registerVMStatusIP(vmCtx *context.VirtualMachineContextA2) { +func (vmm *VMMetrics) registerVMStatusIP(vmCtx *context.VirtualMachineContext) { vm := vmCtx.VM vmCtx.Logger.V(5).Info("Adding metrics for VM IP address assignment status") diff --git a/pkg/patch/patch_test.go b/pkg/patch/patch_test.go index 9f619ffd5..7723232e8 100644 --- a/pkg/patch/patch_test.go +++ b/pkg/patch/patch_test.go @@ -31,7 +31,7 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/test/builder" ) diff --git a/pkg/patch/utils_test.go b/pkg/patch/utils_test.go index 93f3a7da6..c5c488220 100644 --- a/pkg/patch/utils_test.go +++ b/pkg/patch/utils_test.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) func TestToUnstructured(t *testing.T) { diff --git a/pkg/prober/context/probe_context.go b/pkg/prober/context/probe_context.go index 2c30f2892..b4254fa2d 100644 --- a/pkg/prober/context/probe_context.go +++ b/pkg/prober/context/probe_context.go @@ -8,7 +8,7 @@ import ( "github.com/go-logr/logr" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/patch" ) diff --git a/pkg/prober/fake/fake_prober_manager.go b/pkg/prober/fake/fake_prober_manager.go index 5436a4e0e..605e3d08b 100644 --- a/pkg/prober/fake/fake_prober_manager.go +++ b/pkg/prober/fake/fake_prober_manager.go @@ -7,7 +7,7 @@ import ( "context" "sync" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/prober" ) diff --git a/pkg/prober/fake/worker/fake_prober_worker.go b/pkg/prober/fake/worker/fake_prober_worker.go index 2745784b2..0a9e094f4 100644 --- a/pkg/prober/fake/worker/fake_prober_worker.go +++ b/pkg/prober/fake/worker/fake_prober_worker.go @@ -11,7 +11,7 @@ import ( "k8s.io/client-go/util/workqueue" ctrl "sigs.k8s.io/controller-runtime" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/prober/context" "github.com/vmware-tanzu/vm-operator/pkg/prober/probe" diff --git a/pkg/prober/probe/guestinfo_test.go b/pkg/prober/probe/guestinfo_test.go index 399298ffe..74a0061de 100644 --- a/pkg/prober/probe/guestinfo_test.go +++ b/pkg/prober/probe/guestinfo_test.go @@ -13,7 +13,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ctrl "sigs.k8s.io/controller-runtime" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/prober/context" ) diff --git a/pkg/prober/probe/heartbeat.go b/pkg/prober/probe/heartbeat.go index a66f41027..f129bf4a6 100644 --- a/pkg/prober/probe/heartbeat.go +++ b/pkg/prober/probe/heartbeat.go @@ -6,7 +6,7 @@ package probe import ( "fmt" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/prober/context" ) diff --git a/pkg/prober/probe/heartbeat_test.go b/pkg/prober/probe/heartbeat_test.go index 930ca064a..9c48c6355 100644 --- a/pkg/prober/probe/heartbeat_test.go +++ b/pkg/prober/probe/heartbeat_test.go @@ -13,7 +13,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ctrl "sigs.k8s.io/controller-runtime" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/prober/context" ) diff --git a/pkg/prober/probe/probe.go b/pkg/prober/probe/probe.go index d89ace122..b5fcc4b36 100644 --- a/pkg/prober/probe/probe.go +++ b/pkg/prober/probe/probe.go @@ -7,7 +7,7 @@ import ( goctx "context" "time" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/prober/context" ) diff --git a/pkg/prober/probe/tcp.go b/pkg/prober/probe/tcp.go index dc77a28ab..4f4932f56 100644 --- a/pkg/prober/probe/tcp.go +++ b/pkg/prober/probe/tcp.go @@ -12,7 +12,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/intstr" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/prober/context" ) diff --git a/pkg/prober/probe/tcp_test.go b/pkg/prober/probe/tcp_test.go index 867b8925b..a9c96afda 100644 --- a/pkg/prober/probe/tcp_test.go +++ b/pkg/prober/probe/tcp_test.go @@ -17,7 +17,7 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ctrl "sigs.k8s.io/controller-runtime" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/prober/context" ) diff --git a/pkg/prober/prober_manager.go b/pkg/prober/prober_manager.go index a814c8181..8da197f13 100644 --- a/pkg/prober/prober_manager.go +++ b/pkg/prober/prober_manager.go @@ -18,7 +18,7 @@ import ( "github.com/go-logr/logr" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/prober/context" "github.com/vmware-tanzu/vm-operator/pkg/prober/probe" "github.com/vmware-tanzu/vm-operator/pkg/prober/worker" @@ -67,7 +67,7 @@ type manager struct { func NewManager( client client.Client, record vmoprecord.Recorder, - vmProvider vmprovider.VirtualMachineProviderInterfaceA2) Manager { + vmProvider vmprovider.VirtualMachineProviderInterface) Manager { probeManager := &manager{ client: client, @@ -81,7 +81,7 @@ func NewManager( } // AddToManager adds the probe manager controller manager. -func AddToManager(mgr ctrlmgr.Manager, vmProvider vmprovider.VirtualMachineProviderInterfaceA2) (Manager, error) { +func AddToManager(mgr ctrlmgr.Manager, vmProvider vmprovider.VirtualMachineProviderInterface) (Manager, error) { probeRecorder := vmoprecord.New(mgr.GetEventRecorderFor(proberManagerName)) // Add the probe manager explicitly as runnable in order to receive a Start() event. diff --git a/pkg/prober/prober_manager_test.go b/pkg/prober/prober_manager_test.go index cf2fba3d2..1a508c3a0 100644 --- a/pkg/prober/prober_manager_test.go +++ b/pkg/prober/prober_manager_test.go @@ -16,7 +16,7 @@ import ( clientgorecord "k8s.io/client-go/tools/record" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/prober/context" fakeworker "github.com/vmware-tanzu/vm-operator/pkg/prober/fake/worker" @@ -71,7 +71,7 @@ var _ = Describe("VirtualMachine probes", func() { fakeClient = builder.NewFakeClient(initObjects...) eventRecorder := clientgorecord.NewFakeRecorder(1024) fakeRecorder = record.New(eventRecorder) - fakeVMProvider := &fake.VMProviderA2{} + fakeVMProvider := &fake.VMProvider{} testManagerIf := NewManager(fakeClient, fakeRecorder, fakeVMProvider) testManager = testManagerIf.(*manager) fakeWorkerIf = fakeworker.NewFakeWorker(testManager.readinessQueue) diff --git a/pkg/prober/worker/prober_worker.go b/pkg/prober/worker/prober_worker.go index 828b9709e..909742629 100644 --- a/pkg/prober/worker/prober_worker.go +++ b/pkg/prober/worker/prober_worker.go @@ -6,7 +6,7 @@ package worker import ( "k8s.io/client-go/util/workqueue" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/prober/context" "github.com/vmware-tanzu/vm-operator/pkg/prober/probe" diff --git a/pkg/prober/worker/readiness_worker.go b/pkg/prober/worker/readiness_worker.go index f5daaee6c..feed0c8a8 100644 --- a/pkg/prober/worker/readiness_worker.go +++ b/pkg/prober/worker/readiness_worker.go @@ -14,7 +14,7 @@ import ( "github.com/pkg/errors" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/patch" "github.com/vmware-tanzu/vm-operator/pkg/prober/context" diff --git a/pkg/prober/worker/readiness_worker_test.go b/pkg/prober/worker/readiness_worker_test.go index 143dbad90..c6b303318 100644 --- a/pkg/prober/worker/readiness_worker_test.go +++ b/pkg/prober/worker/readiness_worker_test.go @@ -17,7 +17,7 @@ import ( "k8s.io/client-go/util/workqueue" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/prober/context" diff --git a/pkg/util/cloudinit/cloudconfig.go b/pkg/util/cloudinit/cloudconfig.go index 7a3ffd55a..d5959cfba 100644 --- a/pkg/util/cloudinit/cloudconfig.go +++ b/pkg/util/cloudinit/cloudconfig.go @@ -13,8 +13,8 @@ import ( "gopkg.in/yaml.v3" ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/cloudinit" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/cloudinit" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/util" "github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit/validate" diff --git a/pkg/util/cloudinit/cloudconfig_secret.go b/pkg/util/cloudinit/cloudconfig_secret.go index 5a4a9f11a..876f8c8b6 100644 --- a/pkg/util/cloudinit/cloudconfig_secret.go +++ b/pkg/util/cloudinit/cloudconfig_secret.go @@ -10,8 +10,8 @@ import ( ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/cloudinit" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/cloudinit" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/util" ) diff --git a/pkg/util/cloudinit/cloudconfig_secret_test.go b/pkg/util/cloudinit/cloudconfig_secret_test.go index 9686eb887..d010a147e 100644 --- a/pkg/util/cloudinit/cloudconfig_secret_test.go +++ b/pkg/util/cloudinit/cloudconfig_secret_test.go @@ -14,8 +14,8 @@ import ( ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" - vmopv1cloudinit "github.com/vmware-tanzu/vm-operator/api/v1alpha2/cloudinit" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + vmopv1cloudinit "github.com/vmware-tanzu/vm-operator/api/v1alpha3/cloudinit" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit" ) diff --git a/pkg/util/cloudinit/cloudconfig_test.go b/pkg/util/cloudinit/cloudconfig_test.go index cf231f534..ef2a94a38 100644 --- a/pkg/util/cloudinit/cloudconfig_test.go +++ b/pkg/util/cloudinit/cloudconfig_test.go @@ -13,8 +13,8 @@ import ( ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" - vmopv1cloudinit "github.com/vmware-tanzu/vm-operator/api/v1alpha2/cloudinit" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + vmopv1cloudinit "github.com/vmware-tanzu/vm-operator/api/v1alpha3/cloudinit" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit" ) diff --git a/pkg/util/cloudinit/validate/validate.go b/pkg/util/cloudinit/validate/validate.go index 715712a51..90c28234a 100644 --- a/pkg/util/cloudinit/validate/validate.go +++ b/pkg/util/cloudinit/validate/validate.go @@ -9,8 +9,8 @@ import ( "gopkg.in/yaml.v3" "k8s.io/apimachinery/pkg/util/validation/field" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/cloudinit" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/cloudinit" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" cloudinitschema "github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit/schema" ) diff --git a/pkg/util/cloudinit/validate/validate_test.go b/pkg/util/cloudinit/validate/validate_test.go index 69ad8a547..8c1a2b41f 100644 --- a/pkg/util/cloudinit/validate/validate_test.go +++ b/pkg/util/cloudinit/validate/validate_test.go @@ -11,8 +11,8 @@ import ( "k8s.io/apimachinery/pkg/util/validation/field" - vmopv1cloudinit "github.com/vmware-tanzu/vm-operator/api/v1alpha2/cloudinit" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + vmopv1cloudinit "github.com/vmware-tanzu/vm-operator/api/v1alpha3/cloudinit" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" cloudinitvalidate "github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit/validate" ) diff --git a/pkg/util/image/status_to_label.go b/pkg/util/image/status_to_label.go index c38327b6c..182abaf24 100644 --- a/pkg/util/image/status_to_label.go +++ b/pkg/util/image/status_to_label.go @@ -6,7 +6,7 @@ package image import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) // SyncStatusToLabels copies the image's capabilities and OS information from diff --git a/pkg/util/image/status_to_label_test.go b/pkg/util/image/status_to_label_test.go index e1de07f52..b5c2c987d 100644 --- a/pkg/util/image/status_to_label_test.go +++ b/pkg/util/image/status_to_label_test.go @@ -9,7 +9,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" imgutil "github.com/vmware-tanzu/vm-operator/pkg/util/image" ) diff --git a/pkg/vmprovider/fake/fake_vm_provider_a2.go b/pkg/vmprovider/fake/fake_vm_provider.go similarity index 72% rename from pkg/vmprovider/fake/fake_vm_provider_a2.go rename to pkg/vmprovider/fake/fake_vm_provider.go index 49bc3a688..4c4ce6b40 100644 --- a/pkg/vmprovider/fake/fake_vm_provider_a2.go +++ b/pkg/vmprovider/fake/fake_vm_provider.go @@ -15,7 +15,7 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/vmprovider" ) @@ -26,7 +26,7 @@ import ( // to override certain behaviors. The functionality of this provider is // expected to evolve as more tests get added in the future. -type funcsA2 struct { +type funcs struct { CreateOrUpdateVirtualMachineFn func(ctx context.Context, vm *vmopv1.VirtualMachine) error DeleteVirtualMachineFn func(ctx context.Context, vm *vmopv1.VirtualMachine) error PublishVirtualMachineFn func(ctx context.Context, vm *vmopv1.VirtualMachine, @@ -55,9 +55,9 @@ type funcsA2 struct { GetTasksByActIDFn func(ctx context.Context, actID string) (tasksInfo []vimTypes.TaskInfo, retErr error) } -type VMProviderA2 struct { +type VMProvider struct { sync.Mutex - funcsA2 + funcs vmMap map[client.ObjectKey]*vmopv1.VirtualMachine resourcePolicyMap map[client.ObjectKey]*vmopv1.VirtualMachineSetResourcePolicy vmPubMap map[string]vimTypes.TaskInfoState @@ -65,20 +65,20 @@ type VMProviderA2 struct { isPublishVMCalled bool } -var _ vmprovider.VirtualMachineProviderInterfaceA2 = &VMProviderA2{} +var _ vmprovider.VirtualMachineProviderInterface = &VMProvider{} -func (s *VMProviderA2) Reset() { +func (s *VMProvider) Reset() { s.Lock() defer s.Unlock() - s.funcsA2 = funcsA2{} + s.funcs = funcs{} s.vmMap = make(map[client.ObjectKey]*vmopv1.VirtualMachine) s.resourcePolicyMap = make(map[client.ObjectKey]*vmopv1.VirtualMachineSetResourcePolicy) s.vmPubMap = make(map[string]vimTypes.TaskInfoState) s.isPublishVMCalled = false } -func (s *VMProviderA2) CreateOrUpdateVirtualMachine(ctx context.Context, vm *vmopv1.VirtualMachine) error { +func (s *VMProvider) CreateOrUpdateVirtualMachine(ctx context.Context, vm *vmopv1.VirtualMachine) error { s.Lock() defer s.Unlock() if s.CreateOrUpdateVirtualMachineFn != nil { @@ -88,7 +88,7 @@ func (s *VMProviderA2) CreateOrUpdateVirtualMachine(ctx context.Context, vm *vmo return nil } -func (s *VMProviderA2) DeleteVirtualMachine(ctx context.Context, vm *vmopv1.VirtualMachine) error { +func (s *VMProvider) DeleteVirtualMachine(ctx context.Context, vm *vmopv1.VirtualMachine) error { s.Lock() defer s.Unlock() if s.DeleteVirtualMachineFn != nil { @@ -98,7 +98,7 @@ func (s *VMProviderA2) DeleteVirtualMachine(ctx context.Context, vm *vmopv1.Virt return nil } -func (s *VMProviderA2) PublishVirtualMachine(ctx context.Context, vm *vmopv1.VirtualMachine, +func (s *VMProvider) PublishVirtualMachine(ctx context.Context, vm *vmopv1.VirtualMachine, vmPub *vmopv1.VirtualMachinePublishRequest, cl *imgregv1a1.ContentLibrary, actID string) (string, error) { s.Lock() defer s.Unlock() @@ -113,7 +113,7 @@ func (s *VMProviderA2) PublishVirtualMachine(ctx context.Context, vm *vmopv1.Vir return "dummy-id", nil } -func (s *VMProviderA2) GetVirtualMachineGuestHeartbeat(ctx context.Context, vm *vmopv1.VirtualMachine) (vmopv1.GuestHeartbeatStatus, error) { +func (s *VMProvider) GetVirtualMachineGuestHeartbeat(ctx context.Context, vm *vmopv1.VirtualMachine) (vmopv1.GuestHeartbeatStatus, error) { s.Lock() defer s.Unlock() if s.GetVirtualMachineGuestHeartbeatFn != nil { @@ -122,7 +122,7 @@ func (s *VMProviderA2) GetVirtualMachineGuestHeartbeat(ctx context.Context, vm * return "", nil } -func (s *VMProviderA2) GetVirtualMachineGuestInfo(ctx context.Context, vm *vmopv1.VirtualMachine) (map[string]string, error) { +func (s *VMProvider) GetVirtualMachineGuestInfo(ctx context.Context, vm *vmopv1.VirtualMachine) (map[string]string, error) { s.Lock() defer s.Unlock() if s.GetVirtualMachineGuestInfoFn != nil { @@ -131,7 +131,7 @@ func (s *VMProviderA2) GetVirtualMachineGuestInfo(ctx context.Context, vm *vmopv return nil, nil } -func (s *VMProviderA2) GetVirtualMachineWebMKSTicket(ctx context.Context, vm *vmopv1.VirtualMachine, pubKey string) (string, error) { +func (s *VMProvider) GetVirtualMachineWebMKSTicket(ctx context.Context, vm *vmopv1.VirtualMachine, pubKey string) (string, error) { s.Lock() defer s.Unlock() if s.GetVirtualMachineWebMKSTicketFn != nil { @@ -140,7 +140,7 @@ func (s *VMProviderA2) GetVirtualMachineWebMKSTicket(ctx context.Context, vm *vm return "", nil } -func (s *VMProviderA2) GetVirtualMachineHardwareVersion(ctx context.Context, vm *vmopv1.VirtualMachine) (vimTypes.HardwareVersion, error) { +func (s *VMProvider) GetVirtualMachineHardwareVersion(ctx context.Context, vm *vmopv1.VirtualMachine) (vimTypes.HardwareVersion, error) { s.Lock() defer s.Unlock() if s.GetVirtualMachineHardwareVersionFn != nil { @@ -149,7 +149,7 @@ func (s *VMProviderA2) GetVirtualMachineHardwareVersion(ctx context.Context, vm return vimTypes.VMX15, nil } -func (s *VMProviderA2) CreateOrUpdateVirtualMachineSetResourcePolicy(ctx context.Context, resourcePolicy *vmopv1.VirtualMachineSetResourcePolicy) error { +func (s *VMProvider) CreateOrUpdateVirtualMachineSetResourcePolicy(ctx context.Context, resourcePolicy *vmopv1.VirtualMachineSetResourcePolicy) error { s.Lock() defer s.Unlock() @@ -161,7 +161,7 @@ func (s *VMProviderA2) CreateOrUpdateVirtualMachineSetResourcePolicy(ctx context return nil } -func (s *VMProviderA2) IsVirtualMachineSetResourcePolicyReady(ctx context.Context, azName string, resourcePolicy *vmopv1.VirtualMachineSetResourcePolicy) (bool, error) { +func (s *VMProvider) IsVirtualMachineSetResourcePolicyReady(ctx context.Context, azName string, resourcePolicy *vmopv1.VirtualMachineSetResourcePolicy) (bool, error) { s.Lock() defer s.Unlock() @@ -177,7 +177,7 @@ func (s *VMProviderA2) IsVirtualMachineSetResourcePolicyReady(ctx context.Contex return found, nil } -func (s *VMProviderA2) DeleteVirtualMachineSetResourcePolicy(ctx context.Context, resourcePolicy *vmopv1.VirtualMachineSetResourcePolicy) error { +func (s *VMProvider) DeleteVirtualMachineSetResourcePolicy(ctx context.Context, resourcePolicy *vmopv1.VirtualMachineSetResourcePolicy) error { s.Lock() defer s.Unlock() @@ -189,7 +189,7 @@ func (s *VMProviderA2) DeleteVirtualMachineSetResourcePolicy(ctx context.Context return nil } -func (s *VMProviderA2) ComputeCPUMinFrequency(ctx context.Context) error { +func (s *VMProvider) ComputeCPUMinFrequency(ctx context.Context) error { s.Lock() defer s.Unlock() if s.ComputeCPUMinFrequencyFn != nil { @@ -199,7 +199,7 @@ func (s *VMProviderA2) ComputeCPUMinFrequency(ctx context.Context) error { return nil } -func (s *VMProviderA2) UpdateVcPNID(ctx context.Context, vcPNID, vcPort string) error { +func (s *VMProvider) UpdateVcPNID(ctx context.Context, vcPNID, vcPort string) error { s.Lock() defer s.Unlock() if s.UpdateVcPNIDFn != nil { @@ -208,7 +208,7 @@ func (s *VMProviderA2) UpdateVcPNID(ctx context.Context, vcPNID, vcPort string) return nil } -func (s *VMProviderA2) ResetVcClient(ctx context.Context) { +func (s *VMProvider) ResetVcClient(ctx context.Context) { s.Lock() defer s.Unlock() @@ -218,7 +218,7 @@ func (s *VMProviderA2) ResetVcClient(ctx context.Context) { } /* -func (s *VMProviderA2) ListItemsFromContentLibrary(ctx context.Context, contentLibrary *vmopv1.ContentLibraryProvider) ([]string, error) { +func (s *VMProvider) ListItemsFromContentLibrary(ctx context.Context, contentLibrary *vmopv1.ContentLibraryProvider) ([]string, error) { s.Lock() defer s.Unlock() @@ -230,7 +230,7 @@ func (s *VMProviderA2) ListItemsFromContentLibrary(ctx context.Context, contentL return []string{}, nil } -func (s *VMProviderA2) GetVirtualMachineImageFromContentLibrary(ctx context.Context, contentLibrary *vmopv1.ContentLibraryProvider, itemID string, +func (s *VMProvider) GetVirtualMachineImageFromContentLibrary(ctx context.Context, contentLibrary *vmopv1.ContentLibraryProvider, itemID string, currentCLImages map[string]vmopv1.VirtualMachineImage) (*vmopv1.VirtualMachineImage, error) { s.Lock() defer s.Unlock() @@ -244,7 +244,7 @@ func (s *VMProviderA2) GetVirtualMachineImageFromContentLibrary(ctx context.Cont } */ -func (s *VMProviderA2) SyncVirtualMachineImage(ctx context.Context, cli, vmi client.Object) error { +func (s *VMProvider) SyncVirtualMachineImage(ctx context.Context, cli, vmi client.Object) error { s.Lock() defer s.Unlock() @@ -255,7 +255,7 @@ func (s *VMProviderA2) SyncVirtualMachineImage(ctx context.Context, cli, vmi cli return nil } -func (s *VMProviderA2) GetItemFromLibraryByName(ctx context.Context, +func (s *VMProvider) GetItemFromLibraryByName(ctx context.Context, contentLibrary, itemName string) (*library.Item, error) { s.Lock() defer s.Unlock() @@ -267,7 +267,7 @@ func (s *VMProviderA2) GetItemFromLibraryByName(ctx context.Context, return nil, nil } -func (s *VMProviderA2) UpdateContentLibraryItem(ctx context.Context, itemID, newName string, newDescription *string) error { +func (s *VMProvider) UpdateContentLibraryItem(ctx context.Context, itemID, newName string, newDescription *string) error { s.Lock() defer s.Unlock() @@ -277,7 +277,7 @@ func (s *VMProviderA2) UpdateContentLibraryItem(ctx context.Context, itemID, new return nil } -func (s *VMProviderA2) GetTasksByActID(ctx context.Context, actID string) (tasksInfo []vimTypes.TaskInfo, retErr error) { +func (s *VMProvider) GetTasksByActID(ctx context.Context, actID string) (tasksInfo []vimTypes.TaskInfo, retErr error) { s.Lock() defer s.Unlock() @@ -299,7 +299,7 @@ func (s *VMProviderA2) GetTasksByActID(ctx context.Context, actID string) (tasks return []vimTypes.TaskInfo{task1}, nil } -func (s *VMProviderA2) addToVMMap(vm *vmopv1.VirtualMachine) { +func (s *VMProvider) addToVMMap(vm *vmopv1.VirtualMachine) { objectKey := client.ObjectKey{ Namespace: vm.Namespace, Name: vm.Name, @@ -307,7 +307,7 @@ func (s *VMProviderA2) addToVMMap(vm *vmopv1.VirtualMachine) { s.vmMap[objectKey] = vm } -func (s *VMProviderA2) deleteFromVMMap(vm *vmopv1.VirtualMachine) { +func (s *VMProvider) deleteFromVMMap(vm *vmopv1.VirtualMachine) { objectKey := client.ObjectKey{ Namespace: vm.Namespace, Name: vm.Name, @@ -315,7 +315,7 @@ func (s *VMProviderA2) deleteFromVMMap(vm *vmopv1.VirtualMachine) { delete(s.vmMap, objectKey) } -func (s *VMProviderA2) addToResourcePolicyMap(rp *vmopv1.VirtualMachineSetResourcePolicy) { +func (s *VMProvider) addToResourcePolicyMap(rp *vmopv1.VirtualMachineSetResourcePolicy) { objectKey := client.ObjectKey{ Namespace: rp.Namespace, Name: rp.Name, @@ -324,7 +324,7 @@ func (s *VMProviderA2) addToResourcePolicyMap(rp *vmopv1.VirtualMachineSetResour s.resourcePolicyMap[objectKey] = rp } -func (s *VMProviderA2) deleteFromResourcePolicyMap(rp *vmopv1.VirtualMachineSetResourcePolicy) { +func (s *VMProvider) deleteFromResourcePolicyMap(rp *vmopv1.VirtualMachineSetResourcePolicy) { objectKey := client.ObjectKey{ Namespace: rp.Namespace, Name: rp.Name, @@ -332,11 +332,11 @@ func (s *VMProviderA2) deleteFromResourcePolicyMap(rp *vmopv1.VirtualMachineSetR delete(s.resourcePolicyMap, objectKey) } -func (s *VMProviderA2) AddToVMPublishMap(actID string, result vimTypes.TaskInfoState) { +func (s *VMProvider) AddToVMPublishMap(actID string, result vimTypes.TaskInfoState) { s.vmPubMap[actID] = result } -func (s *VMProviderA2) GetVMPublishRequestResult(vmPub *vmopv1.VirtualMachinePublishRequest) vimTypes.TaskInfoState { +func (s *VMProvider) GetVMPublishRequestResult(vmPub *vmopv1.VirtualMachinePublishRequest) vimTypes.TaskInfoState { s.Lock() defer s.Unlock() @@ -344,19 +344,19 @@ func (s *VMProviderA2) GetVMPublishRequestResult(vmPub *vmopv1.VirtualMachinePub return s.vmPubMap[actID] } -func (s *VMProviderA2) GetVMPublishRequestResultWithActIDLocked(actID string) vimTypes.TaskInfoState { +func (s *VMProvider) GetVMPublishRequestResultWithActIDLocked(actID string) vimTypes.TaskInfoState { return s.vmPubMap[actID] } -func (s *VMProviderA2) IsPublishVMCalled() bool { +func (s *VMProvider) IsPublishVMCalled() bool { s.Lock() defer s.Unlock() return s.isPublishVMCalled } -func NewVMProviderA2() *VMProviderA2 { - provider := VMProviderA2{ +func NewVMProvider() *VMProvider { + provider := VMProvider{ vmMap: map[client.ObjectKey]*vmopv1.VirtualMachine{}, resourcePolicyMap: map[client.ObjectKey]*vmopv1.VirtualMachineSetResourcePolicy{}, vmPubMap: map[string]vimTypes.TaskInfoState{}, diff --git a/pkg/vmprovider/interface.go b/pkg/vmprovider/interface.go new file mode 100644 index 000000000..1d811c509 --- /dev/null +++ b/pkg/vmprovider/interface.go @@ -0,0 +1,43 @@ +// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package vmprovider + +import ( + "context" + + "github.com/vmware/govmomi/vapi/library" + vimTypes "github.com/vmware/govmomi/vim25/types" + "sigs.k8s.io/controller-runtime/pkg/client" + + imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" + + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" +) + +// VirtualMachineProviderInterface is a pluggable interface for VM Providers. +type VirtualMachineProviderInterface interface { + CreateOrUpdateVirtualMachine(ctx context.Context, vm *vmopv1.VirtualMachine) error + DeleteVirtualMachine(ctx context.Context, vm *vmopv1.VirtualMachine) error + PublishVirtualMachine(ctx context.Context, vm *vmopv1.VirtualMachine, + vmPub *vmopv1.VirtualMachinePublishRequest, cl *imgregv1a1.ContentLibrary, actID string) (string, error) + GetVirtualMachineGuestHeartbeat(ctx context.Context, vm *vmopv1.VirtualMachine) (vmopv1.GuestHeartbeatStatus, error) + GetVirtualMachineGuestInfo(ctx context.Context, vm *vmopv1.VirtualMachine) (map[string]string, error) + GetVirtualMachineWebMKSTicket(ctx context.Context, vm *vmopv1.VirtualMachine, pubKey string) (string, error) + GetVirtualMachineHardwareVersion(ctx context.Context, vm *vmopv1.VirtualMachine) (vimTypes.HardwareVersion, error) + + CreateOrUpdateVirtualMachineSetResourcePolicy(ctx context.Context, resourcePolicy *vmopv1.VirtualMachineSetResourcePolicy) error + IsVirtualMachineSetResourcePolicyReady(ctx context.Context, availabilityZoneName string, resourcePolicy *vmopv1.VirtualMachineSetResourcePolicy) (bool, error) + DeleteVirtualMachineSetResourcePolicy(ctx context.Context, resourcePolicy *vmopv1.VirtualMachineSetResourcePolicy) error + + // "Infra" related + UpdateVcPNID(ctx context.Context, vcPNID, vcPort string) error + ResetVcClient(ctx context.Context) + ComputeCPUMinFrequency(ctx context.Context) error + + GetItemFromLibraryByName(ctx context.Context, contentLibrary, itemName string) (*library.Item, error) + UpdateContentLibraryItem(ctx context.Context, itemID, newName string, newDescription *string) error + SyncVirtualMachineImage(ctx context.Context, cli, vmi client.Object) error + + GetTasksByActID(ctx context.Context, actID string) (tasksInfo []vimTypes.TaskInfo, retErr error) +} diff --git a/pkg/vmprovider/interface_a2.go b/pkg/vmprovider/interface_a2.go deleted file mode 100644 index fec3621a8..000000000 --- a/pkg/vmprovider/interface_a2.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package vmprovider - -import ( - "context" - - "github.com/vmware/govmomi/vapi/library" - vimTypes "github.com/vmware/govmomi/vim25/types" - "sigs.k8s.io/controller-runtime/pkg/client" - - imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - - "github.com/vmware-tanzu/vm-operator/api/v1alpha2" -) - -// VirtualMachineProviderInterfaceA2 is a plugable interface for VM Providers. -type VirtualMachineProviderInterfaceA2 interface { - CreateOrUpdateVirtualMachine(ctx context.Context, vm *v1alpha2.VirtualMachine) error - DeleteVirtualMachine(ctx context.Context, vm *v1alpha2.VirtualMachine) error - PublishVirtualMachine(ctx context.Context, vm *v1alpha2.VirtualMachine, - vmPub *v1alpha2.VirtualMachinePublishRequest, cl *imgregv1a1.ContentLibrary, actID string) (string, error) - GetVirtualMachineGuestHeartbeat(ctx context.Context, vm *v1alpha2.VirtualMachine) (v1alpha2.GuestHeartbeatStatus, error) - GetVirtualMachineGuestInfo(ctx context.Context, vm *v1alpha2.VirtualMachine) (map[string]string, error) - GetVirtualMachineWebMKSTicket(ctx context.Context, vm *v1alpha2.VirtualMachine, pubKey string) (string, error) - GetVirtualMachineHardwareVersion(ctx context.Context, vm *v1alpha2.VirtualMachine) (vimTypes.HardwareVersion, error) - - CreateOrUpdateVirtualMachineSetResourcePolicy(ctx context.Context, resourcePolicy *v1alpha2.VirtualMachineSetResourcePolicy) error - IsVirtualMachineSetResourcePolicyReady(ctx context.Context, availabilityZoneName string, resourcePolicy *v1alpha2.VirtualMachineSetResourcePolicy) (bool, error) - DeleteVirtualMachineSetResourcePolicy(ctx context.Context, resourcePolicy *v1alpha2.VirtualMachineSetResourcePolicy) error - - // "Infra" related - UpdateVcPNID(ctx context.Context, vcPNID, vcPort string) error - ResetVcClient(ctx context.Context) - ComputeCPUMinFrequency(ctx context.Context) error - - GetItemFromLibraryByName(ctx context.Context, contentLibrary, itemName string) (*library.Item, error) - UpdateContentLibraryItem(ctx context.Context, itemID, newName string, newDescription *string) error - SyncVirtualMachineImage(ctx context.Context, cli, vmi client.Object) error - - GetTasksByActID(ctx context.Context, actID string) (tasksInfo []vimTypes.TaskInfo, retErr error) -} diff --git a/pkg/vmprovider/providers/vsphere2/client/client.go b/pkg/vmprovider/providers/vsphere/client/client.go similarity index 96% rename from pkg/vmprovider/providers/vsphere2/client/client.go rename to pkg/vmprovider/providers/vsphere/client/client.go index 6b0613506..fccf89bd7 100644 --- a/pkg/vmprovider/providers/vsphere2/client/client.go +++ b/pkg/vmprovider/providers/vsphere/client/client.go @@ -7,9 +7,9 @@ import ( "context" "github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/client" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/clustermodules" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/config" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/contentlibrary" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/clustermodules" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/config" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/contentlibrary" ) type Client struct { diff --git a/pkg/vmprovider/providers/vsphere2/client/client_suite_test.go b/pkg/vmprovider/providers/vsphere/client/client_suite_test.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/client/client_suite_test.go rename to pkg/vmprovider/providers/vsphere/client/client_suite_test.go diff --git a/pkg/vmprovider/providers/vsphere2/client/client_test.go b/pkg/vmprovider/providers/vsphere/client/client_test.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/client/client_test.go rename to pkg/vmprovider/providers/vsphere/client/client_test.go index 157089219..9b416231c 100644 --- a/pkg/vmprovider/providers/vsphere2/client/client_test.go +++ b/pkg/vmprovider/providers/vsphere/client/client_test.go @@ -25,9 +25,9 @@ import ( pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" vsphereclient "github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/client" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/client" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/config" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/credentials" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/client" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/config" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/credentials" ) const ( diff --git a/pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules.go b/pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules.go rename to pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules.go diff --git a/pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules_provider.go b/pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules_provider.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules_provider.go rename to pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules_provider.go diff --git a/pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules_suite_test.go b/pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules_suite_test.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules_suite_test.go rename to pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules_suite_test.go diff --git a/pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules_test.go b/pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules_test.go similarity index 91% rename from pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules_test.go rename to pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules_test.go index 0af1e8b88..3a06061c4 100644 --- a/pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules_test.go +++ b/pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules_test.go @@ -9,9 +9,9 @@ import ( "github.com/vmware/govmomi/vim25/types" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/clustermodules" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/clustermodules" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -23,8 +23,8 @@ func cmTests() { cmProvider clustermodules.Provider moduleGroup string - moduleSpec *vmopv1.ClusterModuleSpec - moduleStatus *vmopv1.ClusterModuleStatus + moduleSpec *vmopv1a1.ClusterModuleSpec + moduleStatus *vmopv1a1.ClusterModuleStatus clusterRef types.ManagedObjectReference vmRef types.ManagedObjectReference ) @@ -36,7 +36,7 @@ func cmTests() { clusterRef = ctx.GetFirstClusterFromFirstZone().Reference() moduleGroup = "controller-group" - moduleSpec = &vmopv1.ClusterModuleSpec{ + moduleSpec = &vmopv1a1.ClusterModuleSpec{ GroupName: moduleGroup, } @@ -44,7 +44,7 @@ func cmTests() { Expect(err).NotTo(HaveOccurred()) Expect(moduleID).ToNot(BeEmpty()) - moduleStatus = &vmopv1.ClusterModuleStatus{ + moduleStatus = &vmopv1a1.ClusterModuleStatus{ GroupName: moduleSpec.GroupName, ModuleUuid: moduleID, } diff --git a/pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules_utils.go b/pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules_utils.go similarity index 96% rename from pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules_utils.go rename to pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules_utils.go index 2bfa09ec9..33b80f409 100644 --- a/pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules_utils.go +++ b/pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules_utils.go @@ -9,7 +9,7 @@ import ( "github.com/vmware/govmomi/vim25/types" k8serrors "k8s.io/apimachinery/pkg/util/errors" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) // FindClusterModuleUUID returns the index in the Status.ClusterModules and UUID of the diff --git a/pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules_utils_test.go b/pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules_utils_test.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules_utils_test.go rename to pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules_utils_test.go index e5f4f6f5e..c676e85be 100644 --- a/pkg/vmprovider/providers/vsphere2/clustermodules/cluster_modules_utils_test.go +++ b/pkg/vmprovider/providers/vsphere/clustermodules/cluster_modules_utils_test.go @@ -11,10 +11,10 @@ import ( "github.com/vmware/govmomi/vim25/types" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/clustermodules" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/clustermodules" ) var _ = Describe("FindClusterModuleUUID", func() { diff --git a/pkg/vmprovider/providers/vsphere2/config/config.go b/pkg/vmprovider/providers/vsphere/config/config.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/config/config.go rename to pkg/vmprovider/providers/vsphere/config/config.go index 751cac250..50f895ac3 100644 --- a/pkg/vmprovider/providers/vsphere2/config/config.go +++ b/pkg/vmprovider/providers/vsphere/config/config.go @@ -16,7 +16,7 @@ import ( "github.com/pkg/errors" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/credentials" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/credentials" ) var log = logf.Log.WithName("vsphere").WithName("config") diff --git a/pkg/vmprovider/providers/vsphere2/config/config_suite_test.go b/pkg/vmprovider/providers/vsphere/config/config_suite_test.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/config/config_suite_test.go rename to pkg/vmprovider/providers/vsphere/config/config_suite_test.go diff --git a/pkg/vmprovider/providers/vsphere2/config/config_test.go b/pkg/vmprovider/providers/vsphere/config/config_test.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/config/config_test.go rename to pkg/vmprovider/providers/vsphere/config/config_test.go index 8965478c0..4587e969d 100644 --- a/pkg/vmprovider/providers/vsphere2/config/config_test.go +++ b/pkg/vmprovider/providers/vsphere/config/config_test.go @@ -10,8 +10,8 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/config" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/credentials" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/config" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/credentials" "github.com/vmware-tanzu/vm-operator/test/builder" ) diff --git a/pkg/vmprovider/providers/vsphere2/constants/constants.go b/pkg/vmprovider/providers/vsphere/constants/constants.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/constants/constants.go rename to pkg/vmprovider/providers/vsphere/constants/constants.go diff --git a/pkg/vmprovider/providers/vsphere2/contentlibrary/content_library.go b/pkg/vmprovider/providers/vsphere/contentlibrary/content_library.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/contentlibrary/content_library.go rename to pkg/vmprovider/providers/vsphere/contentlibrary/content_library.go diff --git a/pkg/vmprovider/providers/vsphere2/contentlibrary/content_library_provider.go b/pkg/vmprovider/providers/vsphere/contentlibrary/content_library_provider.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/contentlibrary/content_library_provider.go rename to pkg/vmprovider/providers/vsphere/contentlibrary/content_library_provider.go diff --git a/pkg/vmprovider/providers/vsphere2/contentlibrary/content_library_suite_test.go b/pkg/vmprovider/providers/vsphere/contentlibrary/content_library_suite_test.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/contentlibrary/content_library_suite_test.go rename to pkg/vmprovider/providers/vsphere/contentlibrary/content_library_suite_test.go diff --git a/pkg/vmprovider/providers/vsphere2/contentlibrary/content_library_test.go b/pkg/vmprovider/providers/vsphere/contentlibrary/content_library_test.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/contentlibrary/content_library_test.go rename to pkg/vmprovider/providers/vsphere/contentlibrary/content_library_test.go index dabd9cb50..412d3057c 100644 --- a/pkg/vmprovider/providers/vsphere2/contentlibrary/content_library_test.go +++ b/pkg/vmprovider/providers/vsphere/contentlibrary/content_library_test.go @@ -13,7 +13,7 @@ import ( "github.com/vmware/govmomi/vapi/library" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/contentlibrary" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/contentlibrary" "github.com/vmware-tanzu/vm-operator/test/builder" ) diff --git a/pkg/vmprovider/providers/vsphere2/contentlibrary/content_library_utils.go b/pkg/vmprovider/providers/vsphere/contentlibrary/content_library_utils.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/contentlibrary/content_library_utils.go rename to pkg/vmprovider/providers/vsphere/contentlibrary/content_library_utils.go index 068d3098b..76948f3e7 100644 --- a/pkg/vmprovider/providers/vsphere2/contentlibrary/content_library_utils.go +++ b/pkg/vmprovider/providers/vsphere/contentlibrary/content_library_utils.go @@ -11,10 +11,10 @@ import ( "github.com/vmware/govmomi/ovf" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/conditions" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" ) var vmxRe = regexp.MustCompile(`vmx-(\d+)`) diff --git a/pkg/vmprovider/providers/vsphere2/contentlibrary/content_library_utils_test.go b/pkg/vmprovider/providers/vsphere/contentlibrary/content_library_utils_test.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/contentlibrary/content_library_utils_test.go rename to pkg/vmprovider/providers/vsphere/contentlibrary/content_library_utils_test.go index fcf1ab6ae..e930977f5 100644 --- a/pkg/vmprovider/providers/vsphere2/contentlibrary/content_library_utils_test.go +++ b/pkg/vmprovider/providers/vsphere/contentlibrary/content_library_utils_test.go @@ -10,10 +10,10 @@ import ( "github.com/vmware/govmomi/ovf" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/conditions" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/contentlibrary" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/contentlibrary" "github.com/vmware-tanzu/vm-operator/test/builder" ) diff --git a/pkg/vmprovider/providers/vsphere2/credentials/credentials.go b/pkg/vmprovider/providers/vsphere/credentials/credentials.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/credentials/credentials.go rename to pkg/vmprovider/providers/vsphere/credentials/credentials.go diff --git a/pkg/vmprovider/providers/vsphere2/credentials/credentials_suite_test.go b/pkg/vmprovider/providers/vsphere/credentials/credentials_suite_test.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/credentials/credentials_suite_test.go rename to pkg/vmprovider/providers/vsphere/credentials/credentials_suite_test.go diff --git a/pkg/vmprovider/providers/vsphere2/credentials/credentials_test.go b/pkg/vmprovider/providers/vsphere/credentials/credentials_test.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/credentials/credentials_test.go rename to pkg/vmprovider/providers/vsphere/credentials/credentials_test.go index ec2e66c01..44982bf85 100644 --- a/pkg/vmprovider/providers/vsphere2/credentials/credentials_test.go +++ b/pkg/vmprovider/providers/vsphere/credentials/credentials_test.go @@ -9,7 +9,7 @@ import ( corev1 "k8s.io/api/core/v1" - . "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/credentials" + . "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/credentials" "github.com/vmware-tanzu/vm-operator/test/builder" ) diff --git a/pkg/vmprovider/providers/vsphere2/instancestorage/instance_storage.go b/pkg/vmprovider/providers/vsphere/instancestorage/instance_storage.go similarity index 94% rename from pkg/vmprovider/providers/vsphere2/instancestorage/instance_storage.go rename to pkg/vmprovider/providers/vsphere/instancestorage/instance_storage.go index 698faa7d5..ec8e90735 100644 --- a/pkg/vmprovider/providers/vsphere2/instancestorage/instance_storage.go +++ b/pkg/vmprovider/providers/vsphere/instancestorage/instance_storage.go @@ -8,7 +8,7 @@ import ( apiErrors "k8s.io/apimachinery/pkg/api/errors" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) // IsPresent checks if VM Spec has instance volumes added to its Volumes list. diff --git a/pkg/vmprovider/providers/vsphere2/internal/internal.go b/pkg/vmprovider/providers/vsphere/internal/internal.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/internal/internal.go rename to pkg/vmprovider/providers/vsphere/internal/internal.go diff --git a/pkg/vmprovider/providers/vsphere2/network/gosc.go b/pkg/vmprovider/providers/vsphere/network/gosc.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/network/gosc.go rename to pkg/vmprovider/providers/vsphere/network/gosc.go diff --git a/pkg/vmprovider/providers/vsphere2/network/gosc_test.go b/pkg/vmprovider/providers/vsphere/network/gosc_test.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/network/gosc_test.go rename to pkg/vmprovider/providers/vsphere/network/gosc_test.go index 63d41fe04..d5ee8bb07 100644 --- a/pkg/vmprovider/providers/vsphere2/network/gosc_test.go +++ b/pkg/vmprovider/providers/vsphere/network/gosc_test.go @@ -11,7 +11,7 @@ import ( "github.com/vmware/govmomi/vim25/types" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" ) var _ = Describe("GOSC", func() { diff --git a/pkg/vmprovider/providers/vsphere2/network/netplan.go b/pkg/vmprovider/providers/vsphere/network/netplan.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/network/netplan.go rename to pkg/vmprovider/providers/vsphere/network/netplan.go index 3a121d8e1..fb11153c2 100644 --- a/pkg/vmprovider/providers/vsphere2/network/netplan.go +++ b/pkg/vmprovider/providers/vsphere/network/netplan.go @@ -6,7 +6,7 @@ package network import ( "strings" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" ) // Netplan representation described in https://via.vmw.com/cloud-init-netplan // FIXME: 404. diff --git a/pkg/vmprovider/providers/vsphere2/network/netplan_test.go b/pkg/vmprovider/providers/vsphere/network/netplan_test.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/network/netplan_test.go rename to pkg/vmprovider/providers/vsphere/network/netplan_test.go index 208bec4d7..d8cf3712c 100644 --- a/pkg/vmprovider/providers/vsphere2/network/netplan_test.go +++ b/pkg/vmprovider/providers/vsphere/network/netplan_test.go @@ -9,8 +9,8 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" ) var _ = Describe("Netplan", func() { diff --git a/pkg/vmprovider/providers/vsphere2/network/network.go b/pkg/vmprovider/providers/vsphere/network/network.go similarity index 92% rename from pkg/vmprovider/providers/vsphere2/network/network.go rename to pkg/vmprovider/providers/vsphere/network/network.go index 39d9ddfb1..cd331ead9 100644 --- a/pkg/vmprovider/providers/vsphere2/network/network.go +++ b/pkg/vmprovider/providers/vsphere/network/network.go @@ -27,11 +27,11 @@ import ( ncpv1alpha1 "github.com/vmware-tanzu/vm-operator/external/ncp/api/v1alpha1" netopv1alpha1 "github.com/vmware-tanzu/vm-operator/external/net-operator/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" ) type NetworkInterfaceResults struct { @@ -108,7 +108,7 @@ var ( // - Instead of CreateOrUpdate, use CreateOrPatch to lessen the odds of blowing away // any new fields. func CreateAndWaitForNetworkInterfaces( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, client ctrlruntime.Client, vimClient *vim25.Client, finder *find.Finder, @@ -218,26 +218,34 @@ func applyInterfaceSpecToResult( } func createNamedNetworkInterface( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, finder *find.Finder, interfaceSpec *vmopv1.VirtualMachineNetworkInterfaceSpec) (*NetworkInterfaceResult, error) { - if interfaceSpec.Network.Kind != "" || interfaceSpec.Network.APIVersion != "" { - return nil, fmt.Errorf("network TypeMeta not supported for name network: %v", interfaceSpec.Network.TypeMeta) + var ( + networkRefName string + networkRefType metav1.TypeMeta + ) + if netRef := interfaceSpec.Network; netRef != nil { + networkRefName = netRef.Name + networkRefType = netRef.TypeMeta } - networkName := interfaceSpec.Network.Name - if networkName == "" { + if networkRefType.Kind != "" || networkRefType.APIVersion != "" { + return nil, fmt.Errorf("network TypeMeta not supported for name network: %v", networkRefType) + } + + if networkRefName == "" { return nil, fmt.Errorf("network name is required") } - backing, err := finder.Network(vmCtx, networkName) + backing, err := finder.Network(vmCtx, networkRefName) if err != nil { - return nil, fmt.Errorf("unable to find named network %q: %w", networkName, err) + return nil, fmt.Errorf("unable to find named network %q: %w", networkRefName, err) } return &NetworkInterfaceResult{ - NetworkID: networkName, + NetworkID: networkRefName, Backing: backing, }, nil } @@ -265,21 +273,29 @@ func NetOPCRName(vmName, networkName, interfaceName string, isV1A1 bool) string } func createNetOPNetworkInterface( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, client ctrlruntime.Client, vimClient *vim25.Client, interfaceSpec *vmopv1.VirtualMachineNetworkInterfaceSpec) (*NetworkInterfaceResult, error) { - if kind := interfaceSpec.Network.Kind; kind != "" && kind != "Network" { + var ( + networkRefName string + networkRefType metav1.TypeMeta + ) + if netRef := interfaceSpec.Network; netRef != nil { + networkRefName = netRef.Name + networkRefType = netRef.TypeMeta + } + + if kind := networkRefType.Kind; kind != "" && kind != "Network" { return nil, fmt.Errorf("network kind %q is not supported for VDS", kind) } // If empty, NetOP will try to select a namespace default. - networkName := interfaceSpec.Network.Name netIf := &netopv1alpha1.NetworkInterface{} netIfKey := types.NamespacedName{ Namespace: vmCtx.VM.Namespace, - Name: NetOPCRName(vmCtx.VM.Name, networkName, interfaceSpec.Name, true), + Name: NetOPCRName(vmCtx.VM.Name, networkRefName, interfaceSpec.Name, true), } // check if a networkIf object exists with the older (v1a1) naming convention @@ -290,7 +306,7 @@ func createNetOPNetworkInterface( // if notFound set the netIf to the new v1a2 naming convention netIf.ObjectMeta = metav1.ObjectMeta{ - Name: NetOPCRName(vmCtx.VM.Name, networkName, interfaceSpec.Name, false), + Name: NetOPCRName(vmCtx.VM.Name, networkRefName, interfaceSpec.Name, false), Namespace: vmCtx.VM.Namespace, } } @@ -306,7 +322,7 @@ func createNetOPNetworkInterface( } netIf.Labels[VMNameLabel] = vmCtx.VM.Name - netIf.Spec.NetworkName = networkName + netIf.Spec.NetworkName = networkRefName // NetOP only defines a VMXNet3 type, but it doesn't really matter for our purposes. netIf.Spec.Type = netopv1alpha1.NetworkInterfaceTypeVMXNet3 return nil @@ -365,7 +381,7 @@ func findNetOPCondition( } func waitForReadyNetworkInterface( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, client ctrlruntime.Client, name string) (*netopv1alpha1.NetworkInterface, error) { @@ -422,23 +438,31 @@ func NCPCRName(vmName, networkName, interfaceName string, isV1A1 bool) string { } func createNCPNetworkInterface( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, client ctrlruntime.Client, vimClient *vim25.Client, clusterMoRef *vimtypes.ManagedObjectReference, interfaceSpec *vmopv1.VirtualMachineNetworkInterfaceSpec) (*NetworkInterfaceResult, error) { + var ( + networkRefName string + networkRefType metav1.TypeMeta + ) + if netRef := interfaceSpec.Network; netRef != nil { + networkRefName = netRef.Name + networkRefType = netRef.TypeMeta + } + // TODO: Do we need to still support the odd-ball NetOP in NSX-T? Sigh. Do that check here if needed. - if kind := interfaceSpec.Network.Kind; kind != "" && kind != "VirtualNetwork" { + if kind := networkRefType.Kind; kind != "" && kind != "VirtualNetwork" { return nil, fmt.Errorf("network kind %q is not supported for NCP", kind) } // If empty, NCP will use the namespace default. - networkName := interfaceSpec.Network.Name vnetIf := &ncpv1alpha1.VirtualNetworkInterface{} vnetIfKey := types.NamespacedName{ Namespace: vmCtx.VM.Namespace, - Name: NCPCRName(vmCtx.VM.Name, networkName, interfaceSpec.Name, true), + Name: NCPCRName(vmCtx.VM.Name, networkRefName, interfaceSpec.Name, true), } // check if a networkIf object exists with the older (v1a1) naming convention @@ -449,7 +473,7 @@ func createNCPNetworkInterface( // if notFound set the vnetIf to use the new v1a2 naming convention vnetIf.ObjectMeta = metav1.ObjectMeta{ - Name: NCPCRName(vmCtx.VM.Name, networkName, interfaceSpec.Name, false), + Name: NCPCRName(vmCtx.VM.Name, networkRefName, interfaceSpec.Name, false), Namespace: vmCtx.VM.Namespace, } } @@ -464,7 +488,7 @@ func createNCPNetworkInterface( } vnetIf.Labels[VMNameLabel] = vmCtx.VM.Name - vnetIf.Spec.VirtualNetwork = networkName + vnetIf.Spec.VirtualNetwork = networkRefName return nil }) @@ -556,29 +580,37 @@ func VPCCRName(vmName, networkName, interfaceName string) string { } func createVPCNetworkInterface( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, client ctrlruntime.Client, vimClient *vim25.Client, clusterMoRef *vimtypes.ManagedObjectReference, interfaceSpec *vmopv1.VirtualMachineNetworkInterfaceSpec) (*NetworkInterfaceResult, error) { - networkName := interfaceSpec.Network.Name + var ( + networkRefName string + networkRefType metav1.TypeMeta + ) + if netRef := interfaceSpec.Network; netRef != nil { + networkRefName = netRef.Name + networkRefType = netRef.TypeMeta + } + vpcSubnetPort := &vpcv1alpha1.SubnetPort{ ObjectMeta: metav1.ObjectMeta{ - Name: VPCCRName(vmCtx.VM.Name, networkName, interfaceSpec.Name), + Name: VPCCRName(vmCtx.VM.Name, networkRefName, interfaceSpec.Name), Namespace: vmCtx.VM.Namespace, }, } - switch interfaceSpec.Network.Kind { + switch networkRefType.Kind { case "SubnetSet": - vpcSubnetPort.Spec.SubnetSet = networkName + vpcSubnetPort.Spec.SubnetSet = networkRefName case "": - vpcSubnetPort.Spec.SubnetSet = networkName + vpcSubnetPort.Spec.SubnetSet = networkRefName case "Subnet": - vpcSubnetPort.Spec.Subnet = networkName + vpcSubnetPort.Spec.Subnet = networkRefName default: - return nil, fmt.Errorf("network kind %q is not supported for VPC", interfaceSpec.Network.Kind) + return nil, fmt.Errorf("network kind %q is not supported for VPC", networkRefType.Kind) } _, err := controllerutil.CreateOrUpdate(vmCtx, client, vpcSubnetPort, func() error { @@ -658,7 +690,7 @@ func vpcSubnetPortToResult( } func waitForReadyVPCSubnetPort( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, client ctrlruntime.Client, name string) (*vpcv1alpha1.SubnetPort, error) { @@ -698,7 +730,7 @@ func waitForReadyVPCSubnetPort( } func waitForReadyNCPNetworkInterface( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, client ctrlruntime.Client, name string) (*ncpv1alpha1.VirtualNetworkInterface, error) { diff --git a/pkg/vmprovider/providers/vsphere2/network/network_suite_test.go b/pkg/vmprovider/providers/vsphere/network/network_suite_test.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/network/network_suite_test.go rename to pkg/vmprovider/providers/vsphere/network/network_suite_test.go diff --git a/pkg/vmprovider/providers/vsphere2/network/network_test.go b/pkg/vmprovider/providers/vsphere/network/network_test.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/network/network_test.go rename to pkg/vmprovider/providers/vsphere/network/network_test.go index cc2fb1edf..2b9c229ff 100644 --- a/pkg/vmprovider/providers/vsphere2/network/network_test.go +++ b/pkg/vmprovider/providers/vsphere/network/network_test.go @@ -19,12 +19,12 @@ import ( ncpv1alpha1 "github.com/vmware-tanzu/vm-operator/external/ncp/api/v1alpha1" netopv1alpha1 "github.com/vmware-tanzu/vm-operator/external/net-operator/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -34,7 +34,7 @@ var _ = Describe("CreateAndWaitForNetworkInterfaces", Label(testlabels.VCSim), f testConfig builder.VCSimTestConfig ctx *builder.TestContextForVCSim - vmCtx context.VirtualMachineContextA2 + vmCtx context.VirtualMachineContext vm *vmopv1.VirtualMachine interfaceSpecs []vmopv1.VirtualMachineNetworkInterfaceSpec @@ -59,7 +59,7 @@ var _ = Describe("CreateAndWaitForNetworkInterfaces", Label(testlabels.VCSim), f JustBeforeEach(func() { ctx = suite.NewTestContextForVCSim(testConfig, initObjects...) - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: ctx, Logger: suite.GetLogger().WithName("network_test"), VM: vm, @@ -93,7 +93,7 @@ var _ = Describe("CreateAndWaitForNetworkInterfaces", Label(testlabels.VCSim), f interfaceSpecs = []vmopv1.VirtualMachineNetworkInterfaceSpec{ { Name: "eth0", - Network: common.PartialObjectRef{Name: networkName}, + Network: &common.PartialObjectRef{Name: networkName}, DHCP6: true, }, } @@ -123,7 +123,7 @@ var _ = Describe("CreateAndWaitForNetworkInterfaces", Label(testlabels.VCSim), f { Name: "my-network-interface", GuestDeviceName: "eth42", - Network: common.PartialObjectRef{Name: networkName}, + Network: &common.PartialObjectRef{Name: networkName}, Addresses: []string{ "172.42.1.100/24", "fd1a:6c85:79fe:7c98:0000:0000:0000:000f/56", @@ -194,7 +194,7 @@ var _ = Describe("CreateAndWaitForNetworkInterfaces", Label(testlabels.VCSim), f interfaceSpecs = []vmopv1.VirtualMachineNetworkInterfaceSpec{ { Name: "eth0", - Network: common.PartialObjectRef{Name: "bogus"}, + Network: &common.PartialObjectRef{Name: "bogus"}, }, } }) @@ -223,7 +223,7 @@ var _ = Describe("CreateAndWaitForNetworkInterfaces", Label(testlabels.VCSim), f interfaceSpecs = []vmopv1.VirtualMachineNetworkInterfaceSpec{ { Name: interfaceName, - Network: common.PartialObjectRef{ + Network: &common.PartialObjectRef{ Name: networkName, }, }, @@ -415,7 +415,7 @@ var _ = Describe("CreateAndWaitForNetworkInterfaces", Label(testlabels.VCSim), f interfaceSpecs = []vmopv1.VirtualMachineNetworkInterfaceSpec{ { Name: interfaceName, - Network: common.PartialObjectRef{ + Network: &common.PartialObjectRef{ Name: networkName, }, }, @@ -633,7 +633,7 @@ var _ = Describe("CreateAndWaitForNetworkInterfaces", Label(testlabels.VCSim), f interfaceSpecs = []vmopv1.VirtualMachineNetworkInterfaceSpec{ { Name: interfaceName, - Network: common.PartialObjectRef{ + Network: &common.PartialObjectRef{ Name: networkName, TypeMeta: metav1.TypeMeta{ Kind: "SubnetSet", diff --git a/pkg/vmprovider/providers/vsphere2/network/nsxt.go b/pkg/vmprovider/providers/vsphere/network/nsxt.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/network/nsxt.go rename to pkg/vmprovider/providers/vsphere/network/nsxt.go diff --git a/pkg/vmprovider/providers/vsphere2/network/nsxt_test.go b/pkg/vmprovider/providers/vsphere/network/nsxt_test.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/network/nsxt_test.go rename to pkg/vmprovider/providers/vsphere/network/nsxt_test.go index 40136e8a6..04de24bb0 100644 --- a/pkg/vmprovider/providers/vsphere2/network/nsxt_test.go +++ b/pkg/vmprovider/providers/vsphere/network/nsxt_test.go @@ -8,7 +8,7 @@ import ( . "github.com/onsi/gomega" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" "github.com/vmware-tanzu/vm-operator/test/builder" ) diff --git a/pkg/vmprovider/providers/vsphere2/placement/cluster_placement.go b/pkg/vmprovider/providers/vsphere/placement/cluster_placement.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/placement/cluster_placement.go rename to pkg/vmprovider/providers/vsphere/placement/cluster_placement.go index ad35bec96..6606fd21c 100644 --- a/pkg/vmprovider/providers/vsphere2/placement/cluster_placement.go +++ b/pkg/vmprovider/providers/vsphere/placement/cluster_placement.go @@ -58,7 +58,7 @@ func CheckPlacementRelocateSpec(spec *types.VirtualMachineRelocateSpec) error { } func ParseRelocateVMResponse( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, res *types.PlacementResult) *types.VirtualMachineRelocateSpec { for _, r := range res.Recommendations { @@ -81,7 +81,7 @@ func ParseRelocateVMResponse( } func CloneVMRelocateSpec( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, cluster *object.ClusterComputeResource, vmRef types.ManagedObjectReference, cloneSpec *types.VirtualMachineCloneSpec) (*types.VirtualMachineRelocateSpec, error) { @@ -144,7 +144,7 @@ func PlaceVMForCreate( // ClusterPlaceVMForCreate determines the suitable cluster placement among the specified ResourcePools. func ClusterPlaceVMForCreate( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vim25.Client, resourcePoolsMoRefs []types.ManagedObjectReference, configSpec types.VirtualMachineConfigSpec, diff --git a/pkg/vmprovider/providers/vsphere2/placement/cluster_placement_test.go b/pkg/vmprovider/providers/vsphere/placement/cluster_placement_test.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/placement/cluster_placement_test.go rename to pkg/vmprovider/providers/vsphere/placement/cluster_placement_test.go index 26cb6925a..78e7321dc 100644 --- a/pkg/vmprovider/providers/vsphere2/placement/cluster_placement_test.go +++ b/pkg/vmprovider/providers/vsphere/placement/cluster_placement_test.go @@ -12,7 +12,7 @@ import ( "github.com/vmware/govmomi/vim25/types" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/placement" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/placement" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -59,10 +59,10 @@ func createValidRecommendation() (types.ClusterRecommendation, *types.VirtualMac } var _ = Describe("ParsePlaceVMResponse", func() { - var vmCtx context.VirtualMachineContextA2 + var vmCtx context.VirtualMachineContext BeforeEach(func() { - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: goctx.TODO(), VM: builder.DummyVirtualMachineA2(), Logger: suite.GetLogger(), diff --git a/pkg/vmprovider/providers/vsphere2/placement/placement_suite_test.go b/pkg/vmprovider/providers/vsphere/placement/placement_suite_test.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/placement/placement_suite_test.go rename to pkg/vmprovider/providers/vsphere/placement/placement_suite_test.go diff --git a/pkg/vmprovider/providers/vsphere2/placement/zone_placement.go b/pkg/vmprovider/providers/vsphere/placement/zone_placement.go similarity index 96% rename from pkg/vmprovider/providers/vsphere2/placement/zone_placement.go rename to pkg/vmprovider/providers/vsphere/placement/zone_placement.go index 1bf75cd85..4f399efaa 100644 --- a/pkg/vmprovider/providers/vsphere2/placement/zone_placement.go +++ b/pkg/vmprovider/providers/vsphere/placement/zone_placement.go @@ -17,9 +17,9 @@ import ( pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/topology" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/instancestorage" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vcenter" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/instancestorage" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vcenter" ) type Result struct { @@ -31,7 +31,7 @@ type Result struct { // TODO: Datastore, whatever else as we need it. } -func doesVMNeedPlacement(vmCtx context.VirtualMachineContextA2) (res Result, needZonePlacement, needInstanceStoragePlacement bool) { +func doesVMNeedPlacement(vmCtx context.VirtualMachineContext) (res Result, needZonePlacement, needInstanceStoragePlacement bool) { res.ZonePlacement = true if zoneName := vmCtx.VM.Labels[topology.KubernetesTopologyZoneLabelKey]; zoneName != "" { @@ -62,7 +62,7 @@ func doesVMNeedPlacement(vmCtx context.VirtualMachineContextA2) (res Result, nee // lookupChildRPs lookups the child ResourcePool under each parent ResourcePool. A VM with a ResourcePolicy // may specify a child ResourcePool that the VM will be created under. func lookupChildRPs( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vim25.Client, rpMoIDs []string, zoneName, childRPName string) []string { @@ -87,7 +87,7 @@ func lookupChildRPs( // getPlacementCandidates determines the candidate resource pools for VM placement. func getPlacementCandidates( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, client ctrlclient.Client, vcClient *vim25.Client, zonePlacement bool, @@ -159,7 +159,7 @@ func rpMoIDToCluster( // getPlacementRecommendations calls DRS PlaceVM to determine clusters suitable for placement. func getPlacementRecommendations( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vim25.Client, candidates map[string][]string, configSpec types.VirtualMachineConfigSpec) map[string][]Recommendation { @@ -208,7 +208,7 @@ func getPlacementRecommendations( // getZonalPlacementRecommendations calls DRS PlaceVmsXCluster to determine clusters suitable for placement. func getZonalPlacementRecommendations( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vim25.Client, candidates map[string][]string, configSpec types.VirtualMachineConfigSpec, @@ -283,7 +283,7 @@ func MakePlacementDecision(recommendations map[string][]Recommendation) (string, // Placement determines if the VM needs placement, and if so, determines where to place the VM // and updates the Labels and Annotations with the placement decision. func Placement( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, client ctrlclient.Client, vcClient *vim25.Client, configSpec types.VirtualMachineConfigSpec, diff --git a/pkg/vmprovider/providers/vsphere2/placement/zone_placement_test.go b/pkg/vmprovider/providers/vsphere/placement/zone_placement_test.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/placement/zone_placement_test.go rename to pkg/vmprovider/providers/vsphere/placement/zone_placement_test.go index b65f53d26..a092b22f1 100644 --- a/pkg/vmprovider/providers/vsphere2/placement/zone_placement_test.go +++ b/pkg/vmprovider/providers/vsphere/placement/zone_placement_test.go @@ -10,11 +10,11 @@ import ( "github.com/vmware/govmomi/vim25/types" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/topology" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/placement" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/placement" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -71,7 +71,7 @@ func vcSimPlacement() { testConfig builder.VCSimTestConfig vm *vmopv1.VirtualMachine - vmCtx context.VirtualMachineContextA2 + vmCtx context.VirtualMachineContext configSpec types.VirtualMachineConfigSpec ) @@ -93,7 +93,7 @@ func vcSimPlacement() { vm.Namespace = nsInfo.Namespace - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: ctx, Logger: suite.GetLogger().WithValues("vmName", vm.Name), VM: vm, diff --git a/pkg/vmprovider/providers/vsphere2/resources/vm.go b/pkg/vmprovider/providers/vsphere/resources/vm.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/resources/vm.go rename to pkg/vmprovider/providers/vsphere/resources/vm.go index ddc90e713..dd9729c71 100644 --- a/pkg/vmprovider/providers/vsphere2/resources/vm.go +++ b/pkg/vmprovider/providers/vsphere/resources/vm.go @@ -14,7 +14,7 @@ import ( "github.com/vmware/govmomi/vim25/types" logf "sigs.k8s.io/controller-runtime/pkg/log" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" vmutil "github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/vm" ) diff --git a/pkg/vmprovider/providers/vsphere2/session/session.go b/pkg/vmprovider/providers/vsphere/session/session.go similarity index 90% rename from pkg/vmprovider/providers/vsphere2/session/session.go rename to pkg/vmprovider/providers/vsphere/session/session.go index ea0eb9881..6534029d2 100644 --- a/pkg/vmprovider/providers/vsphere2/session/session.go +++ b/pkg/vmprovider/providers/vsphere/session/session.go @@ -9,9 +9,9 @@ import ( ctrlruntime "sigs.k8s.io/controller-runtime/pkg/client" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/client" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/internal" - res "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/resources" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/client" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/internal" + res "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/resources" ) type Session struct { @@ -23,7 +23,7 @@ type Session struct { Cluster *object.ClusterComputeResource } -func (s *Session) invokeFsrVirtualMachine(vmCtx context.VirtualMachineContextA2, resVM *res.VirtualMachine) error { +func (s *Session) invokeFsrVirtualMachine(vmCtx context.VirtualMachineContext, resVM *res.VirtualMachine) error { vmCtx.Logger.Info("Invoking FSR on VM") task, err := internal.VirtualMachineFSR(vmCtx, resVM.MoRef(), s.Client.VimClient()) diff --git a/pkg/vmprovider/providers/vsphere2/session/session_suite_test.go b/pkg/vmprovider/providers/vsphere/session/session_suite_test.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/session/session_suite_test.go rename to pkg/vmprovider/providers/vsphere/session/session_suite_test.go diff --git a/pkg/vmprovider/providers/vsphere2/session/session_vm.go b/pkg/vmprovider/providers/vsphere/session/session_vm.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/session/session_vm.go rename to pkg/vmprovider/providers/vsphere/session/session_vm.go index 9af708ac8..eee185d28 100644 --- a/pkg/vmprovider/providers/vsphere2/session/session_vm.go +++ b/pkg/vmprovider/providers/vsphere/session/session_vm.go @@ -13,7 +13,7 @@ import ( ) func updateVirtualDiskDeviceChanges( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, virtualDisks object.VirtualDeviceList) ([]vimTypes.BaseVirtualDeviceConfigSpec, error) { advanced := vmCtx.VM.Spec.Advanced diff --git a/pkg/vmprovider/providers/vsphere2/session/session_vm_update.go b/pkg/vmprovider/providers/vsphere/session/session_vm_update.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/session/session_vm_update.go rename to pkg/vmprovider/providers/vsphere/session/session_vm_update.go index 593ecdfed..d9a55de87 100644 --- a/pkg/vmprovider/providers/vsphere2/session/session_vm_update.go +++ b/pkg/vmprovider/providers/vsphere/session/session_vm_update.go @@ -18,17 +18,17 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/ptr" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/util" vmutil "github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/vm" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/clustermodules" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - network2 "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" - res "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/resources" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/virtualmachine" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vmlifecycle" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/clustermodules" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + network2 "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" + res "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/resources" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/virtualmachine" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vmlifecycle" ) // VMUpdateArgs contains the arguments needed to update a VM on VC. @@ -509,7 +509,7 @@ func UpdateConfigSpecFirmware( // updateConfigSpec overlays the VM Class spec with the provided ConfigSpec to form a desired // ConfigSpec that will be used to reconfigure the VM. func updateConfigSpec( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, config *vimTypes.VirtualMachineConfigInfo, updateArgs *VMUpdateArgs) *vimTypes.VirtualMachineConfigSpec { @@ -529,7 +529,7 @@ func updateConfigSpec( } func (s *Session) prePowerOnVMConfigSpec( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, config *vimTypes.VirtualMachineConfigInfo, updateArgs *VMUpdateArgs) (*vimTypes.VirtualMachineConfigSpec, error) { @@ -573,7 +573,7 @@ func (s *Session) prePowerOnVMConfigSpec( } func (s *Session) prePowerOnVMReconfigure( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, resVM *res.VirtualMachine, config *vimTypes.VirtualMachineConfigInfo, updateArgs *VMUpdateArgs) error { @@ -596,7 +596,7 @@ func (s *Session) prePowerOnVMReconfigure( } func (s *Session) ensureNetworkInterfaces( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, configSpec *vimTypes.VirtualMachineConfigSpec) (network2.NetworkInterfaceResults, error) { networkSpec := vmCtx.VM.Spec.Network @@ -668,7 +668,7 @@ func (s *Session) ensureNetworkInterfaces( return results, nil } -func (s *Session) ensureCNSVolumes(vmCtx context.VirtualMachineContextA2) error { +func (s *Session) ensureCNSVolumes(vmCtx context.VirtualMachineContext) error { // If VM spec has a PVC, check if the volume is attached before powering on for _, volume := range vmCtx.VM.Spec.Volumes { if volume.PersistentVolumeClaim == nil { @@ -697,7 +697,7 @@ func (s *Session) ensureCNSVolumes(vmCtx context.VirtualMachineContextA2) error } func (s *Session) fixupMacAddresses( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, resVM *res.VirtualMachine, updateArgs *VMUpdateArgs) error { @@ -732,7 +732,7 @@ func (s *Session) fixupMacAddresses( } func (s *Session) customize( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, resVM *res.VirtualMachine, cfg *vimTypes.VirtualMachineConfigInfo, bootstrapArgs vmlifecycle.BootstrapArgs) error { @@ -741,7 +741,7 @@ func (s *Session) customize( } func (s *Session) prepareVMForPowerOn( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, resVM *res.VirtualMachine, cfg *vimTypes.VirtualMachineConfigInfo, updateArgs *VMUpdateArgs) error { @@ -790,7 +790,7 @@ func (s *Session) prepareVMForPowerOn( } func (s *Session) poweredOnVMReconfigure( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, resVM *res.VirtualMachine, config *vimTypes.VirtualMachineConfigInfo) (bool, error) { @@ -826,7 +826,7 @@ func (s *Session) poweredOnVMReconfigure( } func (s *Session) attachClusterModule( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, resVM *res.VirtualMachine, resourcePolicy *vmopv1.VirtualMachineSetResourcePolicy) error { @@ -846,7 +846,7 @@ func (s *Session) attachClusterModule( } func (s *Session) updateVMDesiredPowerStateOff( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcVM *object.VirtualMachine, moVM *mo.VirtualMachine, existingPowerState vmopv1.VirtualMachinePowerState) (refetchProps bool, err error) { @@ -890,7 +890,7 @@ func (s *Session) updateVMDesiredPowerStateOff( } func (s *Session) updateVMDesiredPowerStateSuspended( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcVM *object.VirtualMachine, existingPowerState vmopv1.VirtualMachinePowerState) (refetchProps bool, err error) { @@ -911,7 +911,7 @@ func (s *Session) updateVMDesiredPowerStateSuspended( } func (s *Session) updateVMDesiredPowerStateOn( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcVM *object.VirtualMachine, moVM *mo.VirtualMachine, getUpdateArgsFn func() (*VMUpdateArgs, error), @@ -1037,7 +1037,7 @@ var VMUpdatePropertiesSelector = []string{ } func (s *Session) UpdateVirtualMachine( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcVM *object.VirtualMachine, getUpdateArgsFn func() (*VMUpdateArgs, error)) error { diff --git a/pkg/vmprovider/providers/vsphere2/session/session_vm_update_test.go b/pkg/vmprovider/providers/vsphere/session/session_vm_update_test.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/session/session_vm_update_test.go rename to pkg/vmprovider/providers/vsphere/session/session_vm_update_test.go index db3bb567d..f20026d23 100644 --- a/pkg/vmprovider/providers/vsphere2/session/session_vm_update_test.go +++ b/pkg/vmprovider/providers/vsphere/session/session_vm_update_test.go @@ -17,13 +17,13 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/ptr" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/util" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/session" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/virtualmachine" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vmlifecycle" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/session" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/virtualmachine" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vmlifecycle" ) var _ = Describe("UpdateVM selected MO Properties", func() { diff --git a/pkg/vmprovider/providers/vsphere2/storage/provisioning.go b/pkg/vmprovider/providers/vsphere/storage/provisioning.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/storage/provisioning.go rename to pkg/vmprovider/providers/vsphere/storage/provisioning.go index 5a3997a65..ddd09a214 100644 --- a/pkg/vmprovider/providers/vsphere2/storage/provisioning.go +++ b/pkg/vmprovider/providers/vsphere/storage/provisioning.go @@ -10,7 +10,7 @@ import ( vimTypes "github.com/vmware/govmomi/vim25/types" "github.com/vmware-tanzu/vm-operator/pkg/context" - vcclient "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/client" + vcclient "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/client" ) // getProfileProportionalCapacity returns the storage profile "proportionalCapacity" value if the @@ -61,7 +61,7 @@ func getProfileProportionalCapacity(profile pbmTypes.BasePbmProfile) int32 { // GetDiskProvisioningForProfile returns the provisioning type for the storage profile if it has // one specified. func GetDiskProvisioningForProfile( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vcclient.Client, storageProfileID string) (string, error) { diff --git a/pkg/vmprovider/providers/vsphere2/storage/storageclass.go b/pkg/vmprovider/providers/vsphere/storage/storageclass.go similarity index 93% rename from pkg/vmprovider/providers/vsphere2/storage/storageclass.go rename to pkg/vmprovider/providers/vsphere/storage/storageclass.go index 68b2e5963..281f1ee0f 100644 --- a/pkg/vmprovider/providers/vsphere2/storage/storageclass.go +++ b/pkg/vmprovider/providers/vsphere/storage/storageclass.go @@ -9,13 +9,13 @@ import ( storagev1 "k8s.io/api/storage/v1" ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/context" ) // getStoragePolicyID returns Storage Policy ID from Storage Class Name. func getStoragePolicyID( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, client ctrlclient.Client, storageClassName string) (string, error) { @@ -35,7 +35,7 @@ func getStoragePolicyID( // GetVMStoragePoliciesIDs returns a map of storage class names to their storage policy IDs. func GetVMStoragePoliciesIDs( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, client ctrlclient.Client) (map[string]string, error) { storageClassNames := getVMStorageClassNames(vmCtx.VM) diff --git a/pkg/vmprovider/providers/vsphere2/sysprep/secret.go b/pkg/vmprovider/providers/vsphere/sysprep/secret.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/sysprep/secret.go rename to pkg/vmprovider/providers/vsphere/sysprep/secret.go index c5f86856e..7a4e985e5 100644 --- a/pkg/vmprovider/providers/vsphere2/sysprep/secret.go +++ b/pkg/vmprovider/providers/vsphere/sysprep/secret.go @@ -8,7 +8,7 @@ import ( ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/sysprep" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/sysprep" "github.com/vmware-tanzu/vm-operator/pkg/util" ) diff --git a/pkg/vmprovider/providers/vsphere2/sysprep/secret_test.go b/pkg/vmprovider/providers/vsphere/sysprep/secret_test.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/sysprep/secret_test.go rename to pkg/vmprovider/providers/vsphere/sysprep/secret_test.go index cbc6d24d8..67ff804e7 100644 --- a/pkg/vmprovider/providers/vsphere2/sysprep/secret_test.go +++ b/pkg/vmprovider/providers/vsphere/sysprep/secret_test.go @@ -16,8 +16,8 @@ import ( ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" - vmopv1sysprep "github.com/vmware-tanzu/vm-operator/api/v1alpha2/sysprep" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/sysprep" + vmopv1sysprep "github.com/vmware-tanzu/vm-operator/api/v1alpha3/sysprep" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/sysprep" ) var _ = Describe("GetSysprepSecretData", func() { diff --git a/pkg/vmprovider/providers/vsphere2/sysprep/suite_test.go b/pkg/vmprovider/providers/vsphere/sysprep/suite_test.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/sysprep/suite_test.go rename to pkg/vmprovider/providers/vsphere/sysprep/suite_test.go diff --git a/pkg/vmprovider/providers/vsphere2/vcenter/cluster.go b/pkg/vmprovider/providers/vsphere/vcenter/cluster.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/vcenter/cluster.go rename to pkg/vmprovider/providers/vsphere/vcenter/cluster.go diff --git a/pkg/vmprovider/providers/vsphere2/vcenter/cluster_test.go b/pkg/vmprovider/providers/vsphere/vcenter/cluster_test.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/vcenter/cluster_test.go rename to pkg/vmprovider/providers/vsphere/vcenter/cluster_test.go index 25a8a00a0..0b6e74ece 100644 --- a/pkg/vmprovider/providers/vsphere2/vcenter/cluster_test.go +++ b/pkg/vmprovider/providers/vsphere/vcenter/cluster_test.go @@ -7,7 +7,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vcenter" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vcenter" "github.com/vmware-tanzu/vm-operator/test/builder" ) diff --git a/pkg/vmprovider/providers/vsphere2/vcenter/folder.go b/pkg/vmprovider/providers/vsphere/vcenter/folder.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/vcenter/folder.go rename to pkg/vmprovider/providers/vsphere/vcenter/folder.go diff --git a/pkg/vmprovider/providers/vsphere2/vcenter/folder_test.go b/pkg/vmprovider/providers/vsphere/vcenter/folder_test.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/vcenter/folder_test.go rename to pkg/vmprovider/providers/vsphere/vcenter/folder_test.go index c5fa9fe3e..3e6e94809 100644 --- a/pkg/vmprovider/providers/vsphere2/vcenter/folder_test.go +++ b/pkg/vmprovider/providers/vsphere/vcenter/folder_test.go @@ -10,7 +10,7 @@ import ( "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/types" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vcenter" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vcenter" "github.com/vmware-tanzu/vm-operator/test/builder" ) diff --git a/pkg/vmprovider/providers/vsphere2/vcenter/getvm.go b/pkg/vmprovider/providers/vsphere/vcenter/getvm.go similarity index 95% rename from pkg/vmprovider/providers/vsphere2/vcenter/getvm.go rename to pkg/vmprovider/providers/vsphere/vcenter/getvm.go index 95b78adfa..484baa038 100644 --- a/pkg/vmprovider/providers/vsphere2/vcenter/getvm.go +++ b/pkg/vmprovider/providers/vsphere/vcenter/getvm.go @@ -12,14 +12,14 @@ import ( "github.com/vmware/govmomi/vim25/types" ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/topology" ) // GetVirtualMachine gets the VM from VC, either by the MoID, UUID, or the inventory path. func GetVirtualMachine( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, k8sClient ctrlclient.Client, vimClient *vim25.Client, datacenter *object.Datacenter, @@ -44,7 +44,7 @@ func GetVirtualMachine( } func findVMByMoID( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, finder *find.Finder, moID string) (*object.VirtualMachine, error) { @@ -64,7 +64,7 @@ func findVMByMoID( //nolint:unused func findVMByUUID( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vimClient *vim25.Client, datacenter *object.Datacenter, uuid string, @@ -87,7 +87,7 @@ func findVMByUUID( } func findVMByInventory( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, k8sClient ctrlclient.Client, vimClient *vim25.Client, finder *find.Finder) (*object.VirtualMachine, error) { diff --git a/pkg/vmprovider/providers/vsphere2/vcenter/getvm_test.go b/pkg/vmprovider/providers/vsphere/vcenter/getvm_test.go similarity index 94% rename from pkg/vmprovider/providers/vsphere2/vcenter/getvm_test.go rename to pkg/vmprovider/providers/vsphere/vcenter/getvm_test.go index 4cc674a42..c85a1729d 100644 --- a/pkg/vmprovider/providers/vsphere2/vcenter/getvm_test.go +++ b/pkg/vmprovider/providers/vsphere/vcenter/getvm_test.go @@ -11,9 +11,9 @@ import ( vimtypes "github.com/vmware/govmomi/vim25/types" "k8s.io/apimachinery/pkg/types" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vcenter" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vcenter" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -29,7 +29,7 @@ func getVM() { ctx *builder.TestContextForVCSim nsInfo builder.WorkloadNamespaceInfo - vmCtx context.VirtualMachineContextA2 + vmCtx context.VirtualMachineContext ) BeforeEach(func() { @@ -40,7 +40,7 @@ func getVM() { vm.Name = "getvm-test" vm.Namespace = nsInfo.Namespace - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: ctx, Logger: suite.GetLogger().WithValues("vmName", vm.Name), VM: vm, @@ -132,7 +132,7 @@ func getVM() { BeforeEach(func() { resourcePolicy, folder := ctx.CreateVirtualMachineSetResourcePolicyA2("getvm-test", nsInfo) if vmCtx.VM.Spec.Reserved == nil { - vmCtx.VM.Spec.Reserved = &v1alpha2.VirtualMachineReservedSpec{} + vmCtx.VM.Spec.Reserved = &vmopv1.VirtualMachineReservedSpec{} } vmCtx.VM.Spec.Reserved.ResourcePolicyName = resourcePolicy.Name @@ -152,7 +152,7 @@ func getVM() { It("returns error when ResourcePolicy does not exist", func() { if vmCtx.VM.Spec.Reserved == nil { - vmCtx.VM.Spec.Reserved = &v1alpha2.VirtualMachineReservedSpec{} + vmCtx.VM.Spec.Reserved = &vmopv1.VirtualMachineReservedSpec{} } vmCtx.VM.Spec.Reserved.ResourcePolicyName = "bogus" diff --git a/pkg/vmprovider/providers/vsphere2/vcenter/host.go b/pkg/vmprovider/providers/vsphere/vcenter/host.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/vcenter/host.go rename to pkg/vmprovider/providers/vsphere/vcenter/host.go diff --git a/pkg/vmprovider/providers/vsphere2/vcenter/host_test.go b/pkg/vmprovider/providers/vsphere/vcenter/host_test.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/vcenter/host_test.go rename to pkg/vmprovider/providers/vsphere/vcenter/host_test.go index 607ba1b34..476e267a8 100644 --- a/pkg/vmprovider/providers/vsphere2/vcenter/host_test.go +++ b/pkg/vmprovider/providers/vsphere/vcenter/host_test.go @@ -9,7 +9,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vcenter" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vcenter" "github.com/vmware-tanzu/vm-operator/test/builder" ) diff --git a/pkg/vmprovider/providers/vsphere2/vcenter/resourcepool.go b/pkg/vmprovider/providers/vsphere/vcenter/resourcepool.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/vcenter/resourcepool.go rename to pkg/vmprovider/providers/vsphere/vcenter/resourcepool.go index 080f1c5af..0f559914b 100644 --- a/pkg/vmprovider/providers/vsphere2/vcenter/resourcepool.go +++ b/pkg/vmprovider/providers/vsphere/vcenter/resourcepool.go @@ -12,7 +12,7 @@ import ( "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/types" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) // GetResourcePoolByMoID returns the ResourcePool for the MoID. diff --git a/pkg/vmprovider/providers/vsphere2/vcenter/resourcepool_test.go b/pkg/vmprovider/providers/vsphere/vcenter/resourcepool_test.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/vcenter/resourcepool_test.go rename to pkg/vmprovider/providers/vsphere/vcenter/resourcepool_test.go index dc3ef49cf..6ddd8a442 100644 --- a/pkg/vmprovider/providers/vsphere2/vcenter/resourcepool_test.go +++ b/pkg/vmprovider/providers/vsphere/vcenter/resourcepool_test.go @@ -9,9 +9,9 @@ import ( "github.com/vmware/govmomi/object" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vcenter" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vcenter" "github.com/vmware-tanzu/vm-operator/test/builder" ) diff --git a/pkg/vmprovider/providers/vsphere2/vcenter/vcenter_suite_test.go b/pkg/vmprovider/providers/vsphere/vcenter/vcenter_suite_test.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/vcenter/vcenter_suite_test.go rename to pkg/vmprovider/providers/vsphere/vcenter/vcenter_suite_test.go diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/backup.go b/pkg/vmprovider/providers/vsphere/virtualmachine/backup.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/backup.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/backup.go index 2bb8ecbe8..310d1b0bb 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/backup.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/backup.go @@ -17,15 +17,15 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" k8syaml "sigs.k8s.io/yaml" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/util" - res "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/resources" + res "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/resources" ) // BackupVirtualMachineOptions contains the options for BackupVirtualMachine. type BackupVirtualMachineOptions struct { - VMCtx context.VirtualMachineContextA2 + VMCtx context.VirtualMachineContext VcVM *object.VirtualMachine DiskUUIDToPVC map[string]corev1.PersistentVolumeClaim AdditionalResources []client.Object diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/backup_test.go b/pkg/vmprovider/providers/vsphere/virtualmachine/backup_test.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/backup_test.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/backup_test.go index 0adc7627d..0a4dcd392 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/backup_test.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/backup_test.go @@ -17,10 +17,10 @@ import ( "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/util" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/virtualmachine" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/virtualmachine" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -36,7 +36,7 @@ func backupTests() { var ( ctx *builder.TestContextForVCSim vcVM *object.VirtualMachine - vmCtx context.VirtualMachineContextA2 + vmCtx context.VirtualMachineContext ) BeforeEach(func() { @@ -46,7 +46,7 @@ func backupTests() { vcVM, err = ctx.Finder.VirtualMachine(ctx, "DC0_C0_RP0_VM0") Expect(err).NotTo(HaveOccurred()) - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: ctx, Logger: suite.GetLogger().WithValues("vmName", vcVM.Name()), VM: &vmopv1.VirtualMachine{}, diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/ccr.go b/pkg/vmprovider/providers/vsphere/virtualmachine/ccr.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/ccr.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/ccr.go diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/ccr_test.go b/pkg/vmprovider/providers/vsphere/virtualmachine/ccr_test.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/ccr_test.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/ccr_test.go index 20ffe07bb..1db08d79e 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/ccr_test.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/ccr_test.go @@ -9,7 +9,7 @@ import ( "github.com/vmware/govmomi/object" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/virtualmachine" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/virtualmachine" "github.com/vmware-tanzu/vm-operator/test/builder" ) diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/configspec.go b/pkg/vmprovider/providers/vsphere/virtualmachine/configspec.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/configspec.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/configspec.go index 088618bfd..d196a71c4 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/configspec.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/configspec.go @@ -7,12 +7,12 @@ import ( "github.com/vmware/govmomi/vim25/types" "k8s.io/utils/ptr" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/util" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/instancestorage" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/instancestorage" ) // CreateConfigSpec returns an initial ConfigSpec that is created by overlaying the @@ -21,7 +21,7 @@ import ( // in the "update" pre-power on path. That operates on a ConfigInfo so we'd need to populate that from // the config we build here. func CreateConfigSpec( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, configSpec types.VirtualMachineConfigSpec, vmClassSpec *vmopv1.VirtualMachineClassSpec, vmImageStatus *vmopv1.VirtualMachineImageStatus, @@ -151,7 +151,7 @@ func determineHardwareVersion( // Placement. configSpec will likely be - or at least derived from - the // ConfigSpec returned by CreateConfigSpec above. func CreateConfigSpecForPlacement( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, configSpec types.VirtualMachineConfigSpec, storageClassesToIDs map[string]string) types.VirtualMachineConfigSpec { diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/configspec_test.go b/pkg/vmprovider/providers/vsphere/virtualmachine/configspec_test.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/configspec_test.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/configspec_test.go index 2a8b24929..a20ecea7a 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/configspec_test.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/configspec_test.go @@ -13,11 +13,11 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/utils/ptr" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/virtualmachine" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/virtualmachine" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -26,7 +26,7 @@ var _ = Describe("CreateConfigSpec", func() { var ( vm *vmopv1.VirtualMachine - vmCtx context.VirtualMachineContextA2 + vmCtx context.VirtualMachineContext vmClassSpec *vmopv1.VirtualMachineClassSpec vmImageStatus *vmopv1.VirtualMachineImageStatus minCPUFreq uint64 @@ -56,7 +56,7 @@ var _ = Describe("CreateConfigSpec", func() { vm.Spec.Volumes = nil vm.Spec.MinHardwareVersion = 0 - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: goctx.Background(), Logger: suite.GetLogger().WithValues("vmName", vm.GetName()), VM: vm, @@ -317,7 +317,7 @@ var _ = Describe("CreateConfigSpec", func() { var _ = Describe("CreateConfigSpecForPlacement", func() { var ( - vmCtx context.VirtualMachineContextA2 + vmCtx context.VirtualMachineContext storageClassesToIDs map[string]string baseConfigSpec vimTypes.VirtualMachineConfigSpec configSpec vimTypes.VirtualMachineConfigSpec @@ -328,7 +328,7 @@ var _ = Describe("CreateConfigSpecForPlacement", func() { storageClassesToIDs = map[string]string{} vm := builder.DummyVirtualMachineA2() - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: pkgconfig.NewContext(), Logger: suite.GetLogger().WithValues("vmName", vm.GetName()), VM: vm, diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/conversion.go b/pkg/vmprovider/providers/vsphere/virtualmachine/conversion.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/conversion.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/conversion.go diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/conversion_test.go b/pkg/vmprovider/providers/vsphere/virtualmachine/conversion_test.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/conversion_test.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/conversion_test.go index 1d43071ea..d81a8f733 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/conversion_test.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/conversion_test.go @@ -9,7 +9,7 @@ import ( "k8s.io/apimachinery/pkg/api/resource" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/virtualmachine" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/virtualmachine" ) var _ = Describe("CPUQuantityToMhz", func() { diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/delete.go b/pkg/vmprovider/providers/vsphere/virtualmachine/delete.go similarity index 96% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/delete.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/delete.go index 7641eaacb..3e4192de9 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/delete.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/delete.go @@ -14,7 +14,7 @@ import ( ) func DeleteVirtualMachine( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcVM *object.VirtualMachine) error { if _, err := vmutil.SetAndWaitOnPowerState( diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/delete_test.go b/pkg/vmprovider/providers/vsphere/virtualmachine/delete_test.go similarity index 94% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/delete_test.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/delete_test.go index 78681a21f..84a00de32 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/delete_test.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/delete_test.go @@ -10,7 +10,7 @@ import ( "github.com/vmware/govmomi/vim25/types" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/virtualmachine" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/virtualmachine" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -19,7 +19,7 @@ func deleteTests() { var ( ctx *builder.TestContextForVCSim vcVM *object.VirtualMachine - vmCtx context.VirtualMachineContextA2 + vmCtx context.VirtualMachineContext ) BeforeEach(func() { @@ -29,7 +29,7 @@ func deleteTests() { vcVM, err = ctx.Finder.VirtualMachine(ctx, "DC0_C0_RP0_VM0") Expect(err).ToNot(HaveOccurred()) - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: ctx, Logger: suite.GetLogger().WithValues("vmName", vcVM.Name()), VM: builder.DummyVirtualMachineA2(), diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/devices.go b/pkg/vmprovider/providers/vsphere/virtualmachine/devices.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/devices.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/devices.go index fa57e7c50..8d3b11a13 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/devices.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/devices.go @@ -7,8 +7,8 @@ import ( vimTypes "github.com/vmware/govmomi/vim25/types" "k8s.io/utils/ptr" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" ) const ( diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/guestinfo.go b/pkg/vmprovider/providers/vsphere/virtualmachine/guestinfo.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/guestinfo.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/guestinfo.go diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/guestinfo_test.go b/pkg/vmprovider/providers/vsphere/virtualmachine/guestinfo_test.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/guestinfo_test.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/guestinfo_test.go index 7727f2d46..acf57f563 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/guestinfo_test.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/guestinfo_test.go @@ -10,7 +10,7 @@ import ( "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/types" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/virtualmachine" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/virtualmachine" "github.com/vmware-tanzu/vm-operator/test/builder" ) diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/heartbeat.go b/pkg/vmprovider/providers/vsphere/virtualmachine/heartbeat.go similarity index 90% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/heartbeat.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/heartbeat.go index 424f8b527..b5a6543b9 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/heartbeat.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/heartbeat.go @@ -9,7 +9,7 @@ import ( "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/mo" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) func GetGuestHeartBeatStatus( diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/publish.go b/pkg/vmprovider/providers/vsphere/virtualmachine/publish.go similarity index 94% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/publish.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/publish.go index f1f13db2b..e8064f81c 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/publish.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/publish.go @@ -12,7 +12,7 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/context" ) @@ -26,7 +26,7 @@ const ( ) func CreateOVF( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, client *rest.Client, vmPubReq *vmopv1.VirtualMachinePublishRequest, cl *imgregv1a1.ContentLibrary, diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/publish_test.go b/pkg/vmprovider/providers/vsphere/virtualmachine/publish_test.go similarity index 94% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/publish_test.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/publish_test.go index a7f7d01e5..cd68d73bd 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/publish_test.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/publish_test.go @@ -12,9 +12,9 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/virtualmachine" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/virtualmachine" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -26,7 +26,7 @@ func publishTests() { vm *vmopv1.VirtualMachine cl *imgregv1a1.ContentLibrary vmPub *vmopv1.VirtualMachinePublishRequest - vmCtx context.VirtualMachineContextA2 + vmCtx context.VirtualMachineContext vmPubCtx context.VirtualMachinePublishRequestContext ) @@ -44,7 +44,7 @@ func publishTests() { vcVM.Name(), "dummy-item-name", "dummy-cl") vmPub.Status.SourceRef = &vmPub.Spec.Source vmPub.Status.TargetRef = &vmPub.Spec.Target - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: ctx, Logger: suite.GetLogger().WithValues("vmName", vcVM.Name()), VM: vm, diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/storage.go b/pkg/vmprovider/providers/vsphere/virtualmachine/storage.go similarity index 91% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/storage.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/storage.go index 0ebacdcd5..6c2abbc2f 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/storage.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/storage.go @@ -6,15 +6,15 @@ package virtualmachine import ( "github.com/vmware/govmomi/vim25/types" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/context" - vcclient "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/client" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/storage" + vcclient "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/client" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/storage" ) // GetDefaultDiskProvisioningType gets the default disk provisioning type specified for the VM. func GetDefaultDiskProvisioningType( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vcclient.Client, storageProfileID string) (string, error) { diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/virtualmachine_suite_test.go b/pkg/vmprovider/providers/vsphere/virtualmachine/virtualmachine_suite_test.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/virtualmachine_suite_test.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/virtualmachine_suite_test.go diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/webconsole_ticket.go b/pkg/vmprovider/providers/vsphere/virtualmachine/webconsole_ticket.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/webconsole_ticket.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/webconsole_ticket.go index cc311b468..42895e287 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/webconsole_ticket.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/webconsole_ticket.go @@ -20,7 +20,7 @@ import ( ) func GetWebConsoleTicket( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vm *object.VirtualMachine, pubKey string) (string, error) { diff --git a/pkg/vmprovider/providers/vsphere2/virtualmachine/webconsole_ticket_test.go b/pkg/vmprovider/providers/vsphere/virtualmachine/webconsole_ticket_test.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/virtualmachine/webconsole_ticket_test.go rename to pkg/vmprovider/providers/vsphere/virtualmachine/webconsole_ticket_test.go index ace064f04..3b212f799 100644 --- a/pkg/vmprovider/providers/vsphere2/virtualmachine/webconsole_ticket_test.go +++ b/pkg/vmprovider/providers/vsphere/virtualmachine/webconsole_ticket_test.go @@ -9,7 +9,7 @@ import ( "crypto/rsa" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/virtualmachine" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/virtualmachine" "github.com/vmware-tanzu/vm-operator/test/builder" ) diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap.go similarity index 96% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap.go index 29d0caeb5..4cf903774 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap.go @@ -13,15 +13,15 @@ import ( apiEquality "k8s.io/apimachinery/pkg/api/equality" ctrl "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit" kubeutil "github.com/vmware-tanzu/vm-operator/pkg/util/kube" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/config" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/resources" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/sysprep" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/config" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/resources" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/sysprep" ) const ( @@ -52,7 +52,7 @@ type BootstrapArgs struct { } func DoBootstrap( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcVM *object.VirtualMachine, config *vimTypes.VirtualMachineConfigInfo, bootstrapArgs BootstrapArgs) error { @@ -121,7 +121,7 @@ func DoBootstrap( // GetBootstrapArgs returns the information used to bootstrap the VM via // one of the many, possible bootstrap engines. func GetBootstrapArgs( - ctx context.VirtualMachineContextA2, + ctx context.VirtualMachineContext, k8sClient ctrl.Client, networkResults network.NetworkInterfaceResults, bootstrapData BootstrapData) (BootstrapArgs, error) { @@ -219,7 +219,7 @@ func GetBootstrapArgs( } func doReconfigure( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcVM *object.VirtualMachine, configSpec *vimTypes.VirtualMachineConfigSpec) error { @@ -237,7 +237,7 @@ func doReconfigure( } func doCustomize( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcVM *object.VirtualMachine, config *vimTypes.VirtualMachineConfigInfo, customSpec *vimTypes.CustomizationSpec) error { diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_cloudinit.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_cloudinit.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_cloudinit.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_cloudinit.go index 51bdb9ae9..69bcc354a 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_cloudinit.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_cloudinit.go @@ -11,13 +11,13 @@ import ( "github.com/vmware/govmomi/vim25/types" "gopkg.in/yaml.v2" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/util" "github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/internal" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/internal" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" ) type CloudInitMetadata struct { @@ -34,7 +34,7 @@ type CloudInitMetadata struct { var CloudInitUserDataSecretKeys = []string{"user-data", "value"} func BootStrapCloudInit( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, config *types.VirtualMachineConfigInfo, cloudInitSpec *vmopv1.VirtualMachineBootstrapCloudInitSpec, bsArgs *BootstrapArgs) (*types.VirtualMachineConfigSpec, *types.CustomizationSpec, error) { diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_cloudinit_test.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_cloudinit_test.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_cloudinit_test.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_cloudinit_test.go index 5001e9e28..bb9440f31 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_cloudinit_test.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_cloudinit_test.go @@ -14,16 +14,16 @@ import ( "gopkg.in/yaml.v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - vmopv1cloudinit "github.com/vmware-tanzu/vm-operator/api/v1alpha2/cloudinit" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + vmopv1cloudinit "github.com/vmware-tanzu/vm-operator/api/v1alpha3/cloudinit" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/util" "github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/internal" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vmlifecycle" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/internal" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vmlifecycle" ) var _ = Describe("CloudInit Bootstrap", func() { @@ -61,7 +61,7 @@ var _ = Describe("CloudInit Bootstrap", func() { custSpec *types.CustomizationSpec err error - vmCtx context.VirtualMachineContextA2 + vmCtx context.VirtualMachineContext vm *vmopv1.VirtualMachine cloudInitSpec *vmopv1.VirtualMachineBootstrapCloudInitSpec ) @@ -78,7 +78,7 @@ var _ = Describe("CloudInit Bootstrap", func() { }, } - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: goctx.Background(), Logger: suite.GetLogger(), VM: vm, diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_linuxprep.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_linuxprep.go similarity index 95% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_linuxprep.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_linuxprep.go index 0f954fd0f..0514f09d0 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_linuxprep.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_linuxprep.go @@ -9,8 +9,8 @@ import ( vimTypes "github.com/vmware/govmomi/vim25/types" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" ) func BootStrapLinuxPrep( diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_linuxprep_test.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_linuxprep_test.go similarity index 94% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_linuxprep_test.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_linuxprep_test.go index e83c9dcaa..1f098e13c 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_linuxprep_test.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_linuxprep_test.go @@ -13,11 +13,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/ptr" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vmlifecycle" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vmlifecycle" ) var _ = Describe("LinuxPrep Bootstrap", func() { @@ -46,7 +46,7 @@ var _ = Describe("LinuxPrep Bootstrap", func() { custSpec *types.CustomizationSpec err error - vmCtx context.VirtualMachineContextA2 + vmCtx context.VirtualMachineContext vm *vmopv1.VirtualMachine linuxPrepSpec *vmopv1.VirtualMachineBootstrapLinuxPrepSpec vAppConfigSpec *vmopv1.VirtualMachineBootstrapVAppConfigSpec @@ -78,7 +78,7 @@ var _ = Describe("LinuxPrep Bootstrap", func() { }, } - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: goctx.Background(), Logger: suite.GetLogger(), VM: vm, diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_sysprep.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_sysprep.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_sysprep.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_sysprep.go index dbb68bed7..f509c2e76 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_sysprep.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_sysprep.go @@ -9,10 +9,10 @@ import ( vimTypes "github.com/vmware/govmomi/vim25/types" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - vmopv1sysprep "github.com/vmware-tanzu/vm-operator/api/v1alpha2/sysprep" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + vmopv1sysprep "github.com/vmware-tanzu/vm-operator/api/v1alpha3/sysprep" "github.com/vmware-tanzu/vm-operator/pkg/util" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" ) func BootstrapSysPrep( diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_sysprep_test.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_sysprep_test.go similarity index 95% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_sysprep_test.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_sysprep_test.go index 40e2112ca..0c73d6be6 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_sysprep_test.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_sysprep_test.go @@ -13,13 +13,13 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/ptr" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" - vmopv1sysprep "github.com/vmware-tanzu/vm-operator/api/v1alpha2/sysprep" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" + vmopv1sysprep "github.com/vmware-tanzu/vm-operator/api/v1alpha3/sysprep" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/sysprep" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vmlifecycle" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/sysprep" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vmlifecycle" ) var _ = Describe("SysPrep Bootstrap", func() { @@ -49,7 +49,7 @@ var _ = Describe("SysPrep Bootstrap", func() { custSpec *types.CustomizationSpec err error - vmCtx context.VirtualMachineContextA2 + vmCtx context.VirtualMachineContext vm *vmopv1.VirtualMachine sysPrepSpec *vmopv1.VirtualMachineBootstrapSysprepSpec vAppConfigSpec *vmopv1.VirtualMachineBootstrapVAppConfigSpec @@ -81,7 +81,7 @@ var _ = Describe("SysPrep Bootstrap", func() { }, } - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: goctx.Background(), Logger: suite.GetLogger(), VM: vm, diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_templatedata.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_templatedata.go similarity index 90% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_templatedata.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_templatedata.go index e80ee1042..447beee84 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_templatedata.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_templatedata.go @@ -13,12 +13,14 @@ import ( "github.com/vmware-tanzu/vm-operator/api/v1alpha1" "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" ) func GetTemplateRenderFunc( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, bsArgs *BootstrapArgs, ) TemplateRenderFunc { @@ -31,19 +33,29 @@ func GetTemplateRenderFunc( Nameservers: bsArgs.DNSServers, } - networkDevicesStatusV1A2 := toTemplateNetworkStatus(bsArgs) + networkDevicesStatusV1A2 := toTemplateNetworkStatusV1A2(bsArgs) networkStatusV1A2 := v1alpha2.NetworkStatus{ Devices: networkDevicesStatusV1A2, Nameservers: bsArgs.DNSServers, } + networkDevicesStatusV1A3 := toTemplateNetworkStatusV1A3(bsArgs) + networkStatusV1A3 := v1alpha3.NetworkStatus{ + Devices: networkDevicesStatusV1A3, + Nameservers: bsArgs.DNSServers, + } + // Oh dear. The VM itself really should not have been included here. v1a1VM := &v1alpha1.VirtualMachine{} _ = v1a1VM.ConvertFrom(vmCtx.VM) + v1a2VM := &v1alpha2.VirtualMachine{} + _ = v1a2VM.ConvertFrom(vmCtx.VM) + templateData := struct { V1alpha1 v1alpha1.VirtualMachineTemplate V1alpha2 v1alpha2.VirtualMachineTemplate + V1alpha3 v1alpha3.VirtualMachineTemplate }{ V1alpha1: v1alpha1.VirtualMachineTemplate{ Net: networkStatusV1A1, @@ -51,6 +63,10 @@ func GetTemplateRenderFunc( }, V1alpha2: v1alpha2.VirtualMachineTemplate{ Net: networkStatusV1A2, + VM: v1a2VM, + }, + V1alpha3: v1alpha3.VirtualMachineTemplate{ + Net: networkStatusV1A3, VM: vmCtx.VM, }, } @@ -244,7 +260,7 @@ func v1a1TemplateFunctions( } } -func toTemplateNetworkStatus(bsArgs *BootstrapArgs) []v1alpha2.NetworkDeviceStatus { +func toTemplateNetworkStatusV1A2(bsArgs *BootstrapArgs) []v1alpha2.NetworkDeviceStatus { networkDevicesStatus := make([]v1alpha2.NetworkDeviceStatus, 0, len(bsArgs.NetworkResults.Results)) for _, result := range bsArgs.NetworkResults.Results { @@ -273,6 +289,35 @@ func toTemplateNetworkStatus(bsArgs *BootstrapArgs) []v1alpha2.NetworkDeviceStat return networkDevicesStatus } +func toTemplateNetworkStatusV1A3(bsArgs *BootstrapArgs) []v1alpha3.NetworkDeviceStatus { + networkDevicesStatus := make([]v1alpha3.NetworkDeviceStatus, 0, len(bsArgs.NetworkResults.Results)) + + for _, result := range bsArgs.NetworkResults.Results { + // When using Sysprep, the MAC address must be in the format of "-". + // CloudInit normalizes it again to ":" when adding it to the netplan. + macAddr := strings.ReplaceAll(result.MacAddress, ":", "-") + + status := v1alpha3.NetworkDeviceStatus{ + MacAddress: macAddr, + } + + for _, ipConfig := range result.IPConfigs { + // We mostly only did IPv4 before so keep that going. + if ipConfig.IsIPv4 { + if status.Gateway4 == "" { + status.Gateway4 = ipConfig.Gateway + } + + status.IPAddresses = append(status.IPAddresses, ipConfig.IPCIDR) + } + } + + networkDevicesStatus = append(networkDevicesStatus, status) + } + + return networkDevicesStatus +} + // This is basically identical to v1a1TemplateFunctions. func v1a2TemplateFunctions( networkStatusV1A2 v1alpha2.NetworkStatus, diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_templatedata_test.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_templatedata_test.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_templatedata_test.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_templatedata_test.go index 8028904bf..bce8e5844 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_templatedata_test.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_templatedata_test.go @@ -11,11 +11,11 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vmlifecycle" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vmlifecycle" ) var _ = Describe("TemplateVMMetadata", func() { @@ -34,7 +34,7 @@ var _ = Describe("TemplateVMMetadata", func() { ) var ( - vmCtx context.VirtualMachineContextA2 + vmCtx context.VirtualMachineContext vm *vmopv1.VirtualMachine bsArgs *vmlifecycle.BootstrapArgs ) @@ -47,7 +47,7 @@ var _ = Describe("TemplateVMMetadata", func() { }, } - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: goctx.Background(), Logger: suite.GetLogger().WithName("bootstrap-template-tests"), VM: vm, diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_test.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_test.go similarity index 96% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_test.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_test.go index 87a316756..0640b8655 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_test.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_test.go @@ -9,8 +9,8 @@ import ( vimTypes "github.com/vmware/govmomi/vim25/types" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vmlifecycle" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vmlifecycle" ) var _ = Describe("Customization utils", func() { diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_vappconfig.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_vappconfig.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_vappconfig.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_vappconfig.go index 4fc319037..8c3696a23 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_vappconfig.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_vappconfig.go @@ -8,7 +8,7 @@ import ( vimTypes "github.com/vmware/govmomi/vim25/types" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) func BootstrapVAppConfig( diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_vappconfig_test.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_vappconfig_test.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_vappconfig_test.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_vappconfig_test.go index 7b9808f59..26c010bf2 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/bootstrap_vappconfig_test.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/bootstrap_vappconfig_test.go @@ -12,9 +12,9 @@ import ( "github.com/vmware/govmomi/vim25/types" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vmlifecycle" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vmlifecycle" ) var _ = Describe("VAppConfig Bootstrap", func() { diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/create.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/create.go similarity index 94% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/create.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/create.go index bbb90a2c9..c4ae744de 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/create.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/create.go @@ -9,7 +9,7 @@ import ( "github.com/vmware/govmomi/vim25/types" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/contentlibrary" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/contentlibrary" ) // CreateArgs contains the arguments needed to create a VM. @@ -27,7 +27,7 @@ type CreateArgs struct { } func CreateVirtualMachine( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, clClient contentlibrary.Provider, restClient *rest.Client, finder *find.Finder, diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/create_clone.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/create_clone.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/create_clone.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/create_clone.go index c48ff27ac..16049fdaf 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/create_clone.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/create_clone.go @@ -13,14 +13,14 @@ import ( "k8s.io/utils/ptr" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/placement" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/placement" ) // CloneVMFromInventory creates a new VM by cloning the source VM. This is not reachable/used // in production because we only really support deploying an OVF via content library. // Maybe someday we'll use clone to speed up VM deployment so keep this code around and unit tested. func cloneVMFromInventory( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, finder *find.Finder, createArgs *CreateArgs) (*vimtypes.ManagedObjectReference, error) { @@ -54,7 +54,7 @@ func cloneVMFromInventory( } func createCloneSpec( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, createArgs *CreateArgs, srcVM *object.VirtualMachine) (*vimtypes.VirtualMachineCloneSpec, error) { @@ -156,7 +156,7 @@ func cloneVMDiskLocators( } func resizeBootDiskDeviceChange( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, virtualDisks object.VirtualDeviceList) []vimtypes.BaseVirtualDeviceConfigSpec { advanced := vmCtx.VM.Spec.Advanced diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/create_contentlibrary.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/create_contentlibrary.go similarity index 94% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/create_contentlibrary.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/create_contentlibrary.go index eef28132f..5af4838c1 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/create_contentlibrary.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/create_contentlibrary.go @@ -15,12 +15,12 @@ import ( "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/util" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/contentlibrary" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/contentlibrary" ) func deployOVF( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, restClient *rest.Client, item *library.Item, createArgs *CreateArgs) (*vimtypes.ManagedObjectReference, error) { @@ -62,7 +62,7 @@ func deployOVF( } func deployVMTX( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, restClient *rest.Client, item *library.Item, createArgs *CreateArgs) (*vimtypes.ManagedObjectReference, error) { @@ -79,7 +79,7 @@ func deployVMTX( } func deployFromContentLibrary( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, clClient contentlibrary.Provider, restClient *rest.Client, createArgs *CreateArgs) (*vimtypes.ManagedObjectReference, error) { diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/update_status.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/update_status.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/update_status.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/update_status.go index 4f28424cb..fca1715a0 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/update_status.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/update_status.go @@ -17,14 +17,14 @@ import ( k8serrors "k8s.io/apimachinery/pkg/util/errors" ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/topology" "github.com/vmware-tanzu/vm-operator/pkg/util" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/virtualmachine" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/virtualmachine" ) var ( @@ -40,7 +40,7 @@ var ( ) func UpdateStatus( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, k8sClient ctrlclient.Client, vcVM *object.VirtualMachine, moVM *mo.VirtualMachine) error { diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/update_status_test.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/update_status_test.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/update_status_test.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/update_status_test.go index e7b7576f9..6451cf749 100644 --- a/pkg/vmprovider/providers/vsphere2/vmlifecycle/update_status_test.go +++ b/pkg/vmprovider/providers/vsphere/vmlifecycle/update_status_test.go @@ -14,12 +14,12 @@ import ( "github.com/vmware/govmomi/vim25/types" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/util" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vmlifecycle" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vmlifecycle" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -27,7 +27,7 @@ var _ = Describe("UpdateStatus", func() { var ( ctx *builder.TestContextForVCSim - vmCtx context.VirtualMachineContextA2 + vmCtx context.VirtualMachineContext vcVM *object.VirtualMachine moVM *mo.VirtualMachine ) @@ -38,7 +38,7 @@ var _ = Describe("UpdateStatus", func() { vm := builder.DummyVirtualMachineA2() vm.Name = "update-status-test" - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: ctx, Logger: suite.GetLogger().WithValues("vmName", vm.Name), VM: vm, diff --git a/pkg/vmprovider/providers/vsphere2/vmlifecycle/vmlifecycle_suite_test.go b/pkg/vmprovider/providers/vsphere/vmlifecycle/vmlifecycle_suite_test.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/vmlifecycle/vmlifecycle_suite_test.go rename to pkg/vmprovider/providers/vsphere/vmlifecycle/vmlifecycle_suite_test.go diff --git a/pkg/vmprovider/providers/vsphere2/vmprovider.go b/pkg/vmprovider/providers/vsphere/vmprovider.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/vmprovider.go rename to pkg/vmprovider/providers/vsphere/vmprovider.go index 8b5338891..812452d24 100644 --- a/pkg/vmprovider/providers/vsphere2/vmprovider.go +++ b/pkg/vmprovider/providers/vsphere/vmprovider.go @@ -25,18 +25,18 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/record" "github.com/vmware-tanzu/vm-operator/pkg/topology" "github.com/vmware-tanzu/vm-operator/pkg/util" "github.com/vmware-tanzu/vm-operator/pkg/vmprovider" - vcclient "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/client" - vcconfig "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/config" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/contentlibrary" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vcenter" + vcclient "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/client" + vcconfig "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/config" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/contentlibrary" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vcenter" ) const ( @@ -72,7 +72,7 @@ type vSphereVMProvider struct { func NewVSphereVMProviderFromClient( ctx goctx.Context, client ctrlruntime.Client, - recorder record.Recorder) vmprovider.VirtualMachineProviderInterfaceA2 { + recorder record.Recorder) vmprovider.VirtualMachineProviderInterface { ovfCache, ovfLockPool := InitOvfCacheAndLockPool( ovfCacheItemExpiration, ovfCacheExpirationCheckInterval, ovfCacheMaxItem) @@ -289,7 +289,7 @@ func (vs *vSphereVMProvider) getOpID(vm *vmopv1.VirtualMachine, operation string } func (vs *vSphereVMProvider) getVM( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, client *vcclient.Client, notFoundReturnErr bool) (*object.VirtualMachine, error) { diff --git a/pkg/vmprovider/providers/vsphere2/vmprovider_resourcepolicy.go b/pkg/vmprovider/providers/vsphere/vmprovider_resourcepolicy.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/vmprovider_resourcepolicy.go rename to pkg/vmprovider/providers/vsphere/vmprovider_resourcepolicy.go index 72604e095..6c2a27920 100644 --- a/pkg/vmprovider/providers/vsphere2/vmprovider_resourcepolicy.go +++ b/pkg/vmprovider/providers/vsphere/vmprovider_resourcepolicy.go @@ -10,10 +10,10 @@ import ( vimtypes "github.com/vmware/govmomi/vim25/types" k8serrors "k8s.io/apimachinery/pkg/util/errors" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/topology" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/clustermodules" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vcenter" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/clustermodules" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vcenter" ) // IsVirtualMachineSetResourcePolicyReady checks if the VirtualMachineSetResourcePolicy for the AZ is ready. diff --git a/pkg/vmprovider/providers/vsphere2/vmprovider_resourcepolicy_test.go b/pkg/vmprovider/providers/vsphere/vmprovider_resourcepolicy_test.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/vmprovider_resourcepolicy_test.go rename to pkg/vmprovider/providers/vsphere/vmprovider_resourcepolicy_test.go index 2f4f13618..d8a52451a 100644 --- a/pkg/vmprovider/providers/vsphere2/vmprovider_resourcepolicy_test.go +++ b/pkg/vmprovider/providers/vsphere/vmprovider_resourcepolicy_test.go @@ -14,9 +14,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/vmprovider" - vsphere "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2" + vsphere "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -46,7 +46,7 @@ func resourcePolicyTests() { ctx *builder.TestContextForVCSim nsInfo builder.WorkloadNamespaceInfo testConfig builder.VCSimTestConfig - vmProvider vmprovider.VirtualMachineProviderInterfaceA2 + vmProvider vmprovider.VirtualMachineProviderInterface ) BeforeEach(func() { diff --git a/pkg/vmprovider/providers/vsphere2/vmprovider_test.go b/pkg/vmprovider/providers/vsphere/vmprovider_test.go similarity index 96% rename from pkg/vmprovider/providers/vsphere2/vmprovider_test.go rename to pkg/vmprovider/providers/vsphere/vmprovider_test.go index 8da4c6982..42cb4f385 100644 --- a/pkg/vmprovider/providers/vsphere2/vmprovider_test.go +++ b/pkg/vmprovider/providers/vsphere/vmprovider_test.go @@ -12,7 +12,7 @@ import ( "github.com/vmware-tanzu/vm-operator/pkg/util" "github.com/vmware-tanzu/vm-operator/pkg/vmprovider" - vsphere "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2" + vsphere "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -21,7 +21,7 @@ func cpuFreqTests() { var ( testConfig builder.VCSimTestConfig ctx *builder.TestContextForVCSim - vmProvider vmprovider.VirtualMachineProviderInterfaceA2 + vmProvider vmprovider.VirtualMachineProviderInterface ) BeforeEach(func() { diff --git a/pkg/vmprovider/providers/vsphere2/vmprovider_vm.go b/pkg/vmprovider/providers/vsphere/vmprovider_vm.go similarity index 95% rename from pkg/vmprovider/providers/vsphere2/vmprovider_vm.go rename to pkg/vmprovider/providers/vsphere/vmprovider_vm.go index d246e0062..a5a487584 100644 --- a/pkg/vmprovider/providers/vsphere2/vmprovider_vm.go +++ b/pkg/vmprovider/providers/vsphere/vmprovider_vm.go @@ -11,7 +11,7 @@ import ( "sync" "text/template" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/session" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/session" "github.com/pkg/errors" "github.com/vmware/govmomi/object" @@ -22,22 +22,22 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/conditions" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/topology" "github.com/vmware-tanzu/vm-operator/pkg/util" kubeutil "github.com/vmware-tanzu/vm-operator/pkg/util/kube" - vcclient "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/client" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/placement" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/storage" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vcenter" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/virtualmachine" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vmlifecycle" + vcclient "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/client" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/placement" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/storage" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vcenter" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/virtualmachine" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vmlifecycle" ) // VMCreateArgs contains the arguments needed to create a VM on VC. @@ -77,7 +77,7 @@ func (vs *vSphereVMProvider) CreateOrUpdateVirtualMachine( ctx goctx.Context, vm *vmopv1.VirtualMachine) error { - vmCtx := context.VirtualMachineContextA2{ + vmCtx := context.VirtualMachineContext{ Context: goctx.WithValue(ctx, types.ID{}, vs.getOpID(vm, "createOrUpdateVM")), Logger: log.WithValues("vmName", vm.NamespacedName()), VM: vm, @@ -117,7 +117,7 @@ func (vs *vSphereVMProvider) DeleteVirtualMachine( ctx goctx.Context, vm *vmopv1.VirtualMachine) error { - vmCtx := context.VirtualMachineContextA2{ + vmCtx := context.VirtualMachineContext{ Context: goctx.WithValue(ctx, types.ID{}, vs.getOpID(vm, "deleteVM")), Logger: log.WithValues("vmName", vm.NamespacedName()), VM: vm, @@ -146,7 +146,7 @@ func (vs *vSphereVMProvider) PublishVirtualMachine( cl *imgregv1a1.ContentLibrary, actID string) (string, error) { - vmCtx := context.VirtualMachineContextA2{ + vmCtx := context.VirtualMachineContext{ Context: ctx, // Update logger info Logger: log.WithValues("vmName", vm.NamespacedName()). @@ -172,7 +172,7 @@ func (vs *vSphereVMProvider) GetVirtualMachineGuestHeartbeat( ctx goctx.Context, vm *vmopv1.VirtualMachine) (vmopv1.GuestHeartbeatStatus, error) { - vmCtx := context.VirtualMachineContextA2{ + vmCtx := context.VirtualMachineContext{ Context: goctx.WithValue(ctx, types.ID{}, vs.getOpID(vm, "heartbeat")), Logger: log.WithValues("vmName", vm.NamespacedName()), VM: vm, @@ -200,7 +200,7 @@ func (vs *vSphereVMProvider) GetVirtualMachineGuestInfo( ctx goctx.Context, vm *vmopv1.VirtualMachine) (map[string]string, error) { - vmCtx := context.VirtualMachineContextA2{ + vmCtx := context.VirtualMachineContext{ Context: goctx.WithValue(ctx, types.ID{}, vs.getOpID(vm, "guestInfo")), Logger: log.WithValues("vmName", vm.NamespacedName()), VM: vm, @@ -229,7 +229,7 @@ func (vs *vSphereVMProvider) GetVirtualMachineWebMKSTicket( vm *vmopv1.VirtualMachine, pubKey string) (string, error) { - vmCtx := context.VirtualMachineContextA2{ + vmCtx := context.VirtualMachineContext{ Context: goctx.WithValue(ctx, types.ID{}, vs.getOpID(vm, "webconsole")), Logger: log.WithValues("vmName", vm.NamespacedName()), VM: vm, @@ -257,7 +257,7 @@ func (vs *vSphereVMProvider) GetVirtualMachineHardwareVersion( ctx goctx.Context, vm *vmopv1.VirtualMachine) (types.HardwareVersion, error) { - vmCtx := context.VirtualMachineContextA2{ + vmCtx := context.VirtualMachineContext{ Context: goctx.WithValue(ctx, types.ID{}, vs.getOpID(vm, "hardware-version")), Logger: log.WithValues("vmName", vm.NamespacedName()), VM: vm, @@ -283,7 +283,7 @@ func (vs *vSphereVMProvider) GetVirtualMachineHardwareVersion( } func (vs *vSphereVMProvider) createVirtualMachine( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vcclient.Client) (*object.VirtualMachine, *VMCreateArgs, error) { createArgs, err := vs.vmCreateGetArgs(vmCtx, vcClient) @@ -349,7 +349,7 @@ func (vs *vSphereVMProvider) createVirtualMachine( } func (vs *vSphereVMProvider) createdVirtualMachineFallthroughUpdate( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcVM *object.VirtualMachine, vcClient *vcclient.Client, createArgs *VMCreateArgs) error { @@ -361,7 +361,7 @@ func (vs *vSphereVMProvider) createdVirtualMachineFallthroughUpdate( } func (vs *vSphereVMProvider) updateVirtualMachine( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcVM *object.VirtualMachine, vcClient *vcclient.Client, createArgs *VMCreateArgs) error { @@ -430,7 +430,7 @@ func (vs *vSphereVMProvider) updateVirtualMachine( // vmCreateDoPlacement determines placement of the VM prior to creating the VM on VC. func (vs *vSphereVMProvider) vmCreateDoPlacement( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vcclient.Client, createArgs *VMCreateArgs) error { @@ -494,7 +494,7 @@ func (vs *vSphereVMProvider) vmCreateDoPlacement( // vmCreateGetFolderAndRPMoIDs gets the MoIDs of the Folder and Resource Pool the VM will be created under. func (vs *vSphereVMProvider) vmCreateGetFolderAndRPMoIDs( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vcclient.Client, createArgs *VMCreateArgs) error { @@ -559,7 +559,7 @@ func (vs *vSphereVMProvider) vmCreateGetFolderAndRPMoIDs( } func (vs *vSphereVMProvider) vmCreateFixupConfigSpec( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vcclient.Client, createArgs *VMCreateArgs) error { @@ -584,7 +584,7 @@ func (vs *vSphereVMProvider) vmCreateFixupConfigSpec( } func (vs *vSphereVMProvider) vmCreateIsReady( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vcclient.Client, createArgs *VMCreateArgs) error { @@ -607,7 +607,7 @@ func (vs *vSphereVMProvider) vmCreateIsReady( return nil } -func (vs *vSphereVMProvider) vmCreateConcurrentAllowed(vmCtx context.VirtualMachineContextA2) (bool, func()) { +func (vs *vSphereVMProvider) vmCreateConcurrentAllowed(vmCtx context.VirtualMachineContext) (bool, func()) { maxDeployThreads := pkgconfig.FromContext(vmCtx).GetMaxDeployThreadsOnProvider() createCountLock.Lock() @@ -630,7 +630,7 @@ func (vs *vSphereVMProvider) vmCreateConcurrentAllowed(vmCtx context.VirtualMach } func (vs *vSphereVMProvider) vmCreateGetArgs( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vcclient.Client) (*VMCreateArgs, error) { createArgs, err := vs.vmCreateGetPrereqs(vmCtx, vcClient) @@ -654,7 +654,7 @@ func (vs *vSphereVMProvider) vmCreateGetArgs( // vmCreateGetPrereqs returns the VMCreateArgs populated with the k8s objects required to // create the VM on VC. func (vs *vSphereVMProvider) vmCreateGetPrereqs( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vcclient.Client) (*VMCreateArgs, error) { createArgs := &VMCreateArgs{} @@ -706,7 +706,7 @@ func (vs *vSphereVMProvider) vmCreateGetPrereqs( } func (vs *vSphereVMProvider) vmCreateGetVirtualMachineClass( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, createArgs *VMCreateArgs) error { vmClass, err := GetVirtualMachineClass(vmCtx, vs.k8sClient) @@ -720,7 +720,7 @@ func (vs *vSphereVMProvider) vmCreateGetVirtualMachineClass( } func (vs *vSphereVMProvider) vmCreateGetVirtualMachineImage( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, createArgs *VMCreateArgs) error { imageObj, imageSpec, imageStatus, err := GetVirtualMachineImageSpecAndStatus(vmCtx, vs.k8sClient) @@ -732,15 +732,20 @@ func (vs *vSphereVMProvider) vmCreateGetVirtualMachineImage( createArgs.ImageSpec = imageSpec createArgs.ImageStatus = imageStatus + var providerRef common.LocalObjectRef + if imageSpec.ProviderRef != nil { + providerRef = *imageSpec.ProviderRef + } + // This is clunky, but we need to know how to use the image to create the VM. Our only supported // method is via the ContentLibrary, so check if this image was derived from a CL item. - switch imageSpec.ProviderRef.Kind { + switch providerRef.Kind { case "ClusterContentLibraryItem", "ContentLibraryItem": createArgs.UseContentLibrary = true createArgs.ProviderItemID = imageStatus.ProviderItemID default: if !SkipVMImageCLProviderCheck { - err := fmt.Errorf("unsupported image provider kind: %s", imageSpec.ProviderRef.Kind) + err := fmt.Errorf("unsupported image provider kind: %s", providerRef.Kind) conditions.MarkFalse(vmCtx.VM, vmopv1.VirtualMachineConditionImageReady, "NotSupported", err.Error()) return err } @@ -753,7 +758,7 @@ func (vs *vSphereVMProvider) vmCreateGetVirtualMachineImage( } func (vs *vSphereVMProvider) vmCreateGetSetResourcePolicy( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, createArgs *VMCreateArgs) error { resourcePolicy, err := GetVMSetResourcePolicy(vmCtx, vs.k8sClient) @@ -772,7 +777,7 @@ func (vs *vSphereVMProvider) vmCreateGetSetResourcePolicy( } func (vs *vSphereVMProvider) vmCreateGetBootstrap( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, createArgs *VMCreateArgs) error { bsData, err := GetVirtualMachineBootstrap(vmCtx, vs.k8sClient) @@ -790,7 +795,7 @@ func (vs *vSphereVMProvider) vmCreateGetBootstrap( } func (vs *vSphereVMProvider) vmCreateGetStoragePrereqs( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vcclient.Client, createArgs *VMCreateArgs) error { @@ -859,7 +864,7 @@ func (vs *vSphereVMProvider) vmCreateGetStoragePrereqs( } func (vs *vSphereVMProvider) vmCreateDoNetworking( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vcClient *vcclient.Client, createArgs *VMCreateArgs) error { @@ -888,7 +893,7 @@ func (vs *vSphereVMProvider) vmCreateDoNetworking( } func (vs *vSphereVMProvider) vmCreateGenConfigSpec( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, createArgs *VMCreateArgs) error { // TODO: This is a partial dupe of what's done in the update path in the remaining Session code. I got @@ -940,7 +945,7 @@ func (vs *vSphereVMProvider) vmCreateGenConfigSpec( } func (vs *vSphereVMProvider) vmCreateGenConfigSpecExtraConfig( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, createArgs *VMCreateArgs) error { ecMap := maps.Clone(vs.globalExtraConfig) @@ -984,7 +989,7 @@ func (vs *vSphereVMProvider) vmCreateGenConfigSpecExtraConfig( } func (vs *vSphereVMProvider) vmCreateGenConfigSpecChangeBootDiskSize( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, _ *VMCreateArgs) error { advanced := vmCtx.VM.Spec.Advanced @@ -1000,7 +1005,7 @@ func (vs *vSphereVMProvider) vmCreateGenConfigSpecChangeBootDiskSize( } func (vs *vSphereVMProvider) vmCreateGenConfigSpecZipNetworkInterfaces( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, createArgs *VMCreateArgs) error { if vmCtx.VM.Spec.Network == nil || vmCtx.VM.Spec.Network.Disabled { @@ -1067,7 +1072,7 @@ func (vs *vSphereVMProvider) vmCreateGenConfigSpecZipNetworkInterfaces( } func (vs *vSphereVMProvider) vmUpdateGetArgs( - vmCtx context.VirtualMachineContextA2) (*vmUpdateArgs, error) { + vmCtx context.VirtualMachineContext) (*vmUpdateArgs, error) { vmClass, err := GetVirtualMachineClass(vmCtx, vs.k8sClient) if err != nil { diff --git a/pkg/vmprovider/providers/vsphere2/vmprovider_vm2_test.go b/pkg/vmprovider/providers/vsphere/vmprovider_vm2_test.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/vmprovider_vm2_test.go rename to pkg/vmprovider/providers/vsphere/vmprovider_vm2_test.go index ff2641ca0..809027de7 100644 --- a/pkg/vmprovider/providers/vsphere2/vmprovider_vm2_test.go +++ b/pkg/vmprovider/providers/vsphere/vmprovider_vm2_test.go @@ -19,13 +19,13 @@ import ( ncpv1alpha1 "github.com/vmware-tanzu/vm-operator/external/ncp/api/v1alpha1" netopv1alpha1 "github.com/vmware-tanzu/vm-operator/external/net-operator/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/conditions" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/vmprovider" - vsphere "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network" + vsphere "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -41,7 +41,7 @@ func vmE2ETests() { initObjects []client.Object testConfig builder.VCSimTestConfig ctx *builder.TestContextForVCSim - vmProvider vmprovider.VirtualMachineProviderInterfaceA2 + vmProvider vmprovider.VirtualMachineProviderInterface nsInfo builder.WorkloadNamespaceInfo vm *vmopv1.VirtualMachine @@ -158,7 +158,7 @@ func vmE2ETests() { Interfaces: []vmopv1.VirtualMachineNetworkInterfaceSpec{ { Name: interfaceName, - Network: common.PartialObjectRef{ + Network: &common.PartialObjectRef{ Name: networkName, }, }, @@ -265,7 +265,7 @@ func vmE2ETests() { Interfaces: []vmopv1.VirtualMachineNetworkInterfaceSpec{ { Name: interfaceName, - Network: common.PartialObjectRef{ + Network: &common.PartialObjectRef{ Name: networkName, }, }, @@ -374,7 +374,7 @@ func vmE2ETests() { Interfaces: []vmopv1.VirtualMachineNetworkInterfaceSpec{ { Name: interfaceName, - Network: common.PartialObjectRef{ + Network: &common.PartialObjectRef{ Name: networkName, TypeMeta: metav1.TypeMeta{ Kind: "Subnet", diff --git a/pkg/vmprovider/providers/vsphere2/vmprovider_vm_test.go b/pkg/vmprovider/providers/vsphere/vmprovider_vm_test.go similarity index 99% rename from pkg/vmprovider/providers/vsphere2/vmprovider_vm_test.go rename to pkg/vmprovider/providers/vsphere/vmprovider_vm_test.go index c0f0f8373..d6aed5e00 100644 --- a/pkg/vmprovider/providers/vsphere2/vmprovider_vm_test.go +++ b/pkg/vmprovider/providers/vsphere/vmprovider_vm_test.go @@ -24,18 +24,18 @@ import ( "github.com/vmware/govmomi/vim25/mo" vimTypes "github.com/vmware/govmomi/vim25/types" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/conditions" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/topology" "github.com/vmware-tanzu/vm-operator/pkg/util" kubeutil "github.com/vmware-tanzu/vm-operator/pkg/util/kube" "github.com/vmware-tanzu/vm-operator/pkg/vmprovider" - vsphere "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/instancestorage" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/virtualmachine" + vsphere "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/instancestorage" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/virtualmachine" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -53,7 +53,7 @@ func vmTests() { initObjects []client.Object testConfig builder.VCSimTestConfig ctx *builder.TestContextForVCSim - vmProvider vmprovider.VirtualMachineProviderInterfaceA2 + vmProvider vmprovider.VirtualMachineProviderInterface nsInfo builder.WorkloadNamespaceInfo ) @@ -195,7 +195,7 @@ func vmTests() { vm.Spec.Network.Interfaces = []vmopv1.VirtualMachineNetworkInterfaceSpec{ { Name: "eth0", - Network: common.PartialObjectRef{Name: dvpgName}, + Network: &common.PartialObjectRef{Name: dvpgName}, }, } @@ -1528,11 +1528,11 @@ func vmTests() { vm.Spec.Network.Interfaces = []vmopv1.VirtualMachineNetworkInterfaceSpec{ { Name: "eth0", - Network: common.PartialObjectRef{Name: "VM Network"}, + Network: &common.PartialObjectRef{Name: "VM Network"}, }, { Name: "eth1", - Network: common.PartialObjectRef{Name: dvpgName}, + Network: &common.PartialObjectRef{Name: dvpgName}, }, } }) diff --git a/pkg/vmprovider/providers/vsphere2/vmprovider_vm_utils.go b/pkg/vmprovider/providers/vsphere/vmprovider_vm_utils.go similarity index 97% rename from pkg/vmprovider/providers/vsphere2/vmprovider_vm_utils.go rename to pkg/vmprovider/providers/vsphere/vmprovider_vm_utils.go index 5708ba6a4..f1ff0a2cb 100644 --- a/pkg/vmprovider/providers/vsphere2/vmprovider_vm_utils.go +++ b/pkg/vmprovider/providers/vsphere/vmprovider_vm_utils.go @@ -14,16 +14,16 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/pkg/util" "github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit" "github.com/vmware-tanzu/vm-operator/pkg/util/kube" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/instancestorage" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/sysprep" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vmlifecycle" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/instancestorage" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/sysprep" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vmlifecycle" ) // TODO: This mostly just a placeholder until we spend time on something better. Individual types @@ -44,7 +44,7 @@ func errToConditionReasonAndMessage(err error) (string, string) { } func GetVirtualMachineClass( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, k8sClient ctrlclient.Client) (*vmopv1.VirtualMachineClass, error) { key := ctrlclient.ObjectKey{Name: vmCtx.VM.Spec.ClassName, Namespace: vmCtx.VM.Namespace} @@ -61,7 +61,7 @@ func GetVirtualMachineClass( } func GetVirtualMachineImageSpecAndStatus( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, k8sClient ctrlclient.Client) (ctrlclient.Object, *vmopv1.VirtualMachineImageSpec, *vmopv1.VirtualMachineImageStatus, error) { var obj conditions.Getter @@ -118,7 +118,7 @@ func GetVirtualMachineImageSpecAndStatus( } func getSecretData( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, k8sClient ctrlclient.Client, secretName, secretKey string, configMapFallback, isCloudInitSecret bool) (map[string]string, error) { @@ -183,7 +183,7 @@ func getSecretData( } func GetVirtualMachineBootstrap( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, k8sClient ctrlclient.Client) (vmlifecycle.BootstrapData, error) { bootstrapSpec := vmCtx.VM.Spec.Bootstrap @@ -299,7 +299,7 @@ func GetVirtualMachineBootstrap( } func GetVMSetResourcePolicy( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, k8sClient ctrlclient.Client) (*vmopv1.VirtualMachineSetResourcePolicy, error) { var rpName string @@ -336,7 +336,7 @@ func GetVMSetResourcePolicy( // AddInstanceStorageVolumes checks if VM class is configured with instance storage volumes and appends the // volumes to the VM's Spec if not already done. Return true if the VM had or now has instance storage volumes. func AddInstanceStorageVolumes( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, vmClass *vmopv1.VirtualMachineClass) bool { if instancestorage.IsPresent(vmCtx.VM) { @@ -393,7 +393,7 @@ func GetVMClassConfigSpec( // GetAttachedDiskUUIDToPVC returns a map of disk UUID to PVC object for all // attached disks by checking the VM's spec and status of volumes. func GetAttachedDiskUUIDToPVC( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, k8sClient ctrlclient.Client) (map[string]corev1.PersistentVolumeClaim, error) { if len(vmCtx.VM.Spec.Volumes) == 0 { @@ -438,7 +438,7 @@ func GetAttachedDiskUUIDToPVC( // GetAdditionalResourcesForBackup returns a list of Kubernetes client objects // that are relevant for VM backup (e.g. bootstrap referenced resources). func GetAdditionalResourcesForBackup( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, k8sClient ctrlclient.Client) ([]ctrlclient.Object, error) { var objects []ctrlclient.Object // Get bootstrap related objects from CloudInit or Sysprep (mutually exclusive). @@ -516,7 +516,7 @@ func GetAdditionalResourcesForBackup( } func getSecretOrConfigMapObject( - vmCtx context.VirtualMachineContextA2, + vmCtx context.VirtualMachineContext, k8sClient ctrlclient.Client, resourceName string, configMapFallback bool) (ctrlclient.Object, error) { diff --git a/pkg/vmprovider/providers/vsphere2/vmprovider_vm_utils_test.go b/pkg/vmprovider/providers/vsphere/vmprovider_vm_utils_test.go similarity index 98% rename from pkg/vmprovider/providers/vsphere2/vmprovider_vm_utils_test.go rename to pkg/vmprovider/providers/vsphere/vmprovider_vm_utils_test.go index d7c09cd01..3950c0251 100644 --- a/pkg/vmprovider/providers/vsphere2/vmprovider_vm_utils_test.go +++ b/pkg/vmprovider/providers/vsphere/vmprovider_vm_utils_test.go @@ -13,15 +13,15 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/cloudinit" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/sysprep" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/cloudinit" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/sysprep" "github.com/vmware-tanzu/vm-operator/pkg/conditions" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/context" - vsphere "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/instancestorage" + vsphere "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/instancestorage" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -31,13 +31,13 @@ func vmUtilTests() { k8sClient client.Client initObjects []client.Object - vmCtx context.VirtualMachineContextA2 + vmCtx context.VirtualMachineContext ) BeforeEach(func() { vm := builder.DummyBasicVirtualMachineA2("test-vm", "dummy-ns") - vmCtx = context.VirtualMachineContextA2{ + vmCtx = context.VirtualMachineContext{ Context: pkgconfig.WithConfig(pkgconfig.Config{MaxDeployThreadsOnProvider: 16}), Logger: suite.GetLogger().WithValues("vmName", vm.Name), VM: vm, diff --git a/pkg/vmprovider/providers/vsphere2/vsphere_suite_test.go b/pkg/vmprovider/providers/vsphere/vsphere_suite_test.go similarity index 100% rename from pkg/vmprovider/providers/vsphere2/vsphere_suite_test.go rename to pkg/vmprovider/providers/vsphere/vsphere_suite_test.go diff --git a/pkg/webconsolevalidation/server.go b/pkg/webconsolevalidation/server.go index fdf7784e6..d56ad1d3f 100644 --- a/pkg/webconsolevalidation/server.go +++ b/pkg/webconsolevalidation/server.go @@ -13,7 +13,7 @@ import ( ctrlruntime "sigs.k8s.io/controller-runtime/pkg/client" ctrllog "sigs.k8s.io/controller-runtime/pkg/log" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1" ) @@ -28,7 +28,7 @@ func InitServer() error { } scheme := runtime.NewScheme() - if err = vmopv1.AddToScheme(scheme); err != nil { + if err = vmopv1a1.AddToScheme(scheme); err != nil { return err } @@ -93,7 +93,7 @@ func isResourceFound(goCtx context.Context, uuid, namespace string) (bool, error } // TODO: Use an Informer to avoid hitting the API server for every request. - wcrObjectList := &vmopv1.WebConsoleRequestList{} + wcrObjectList := &vmopv1a1.WebConsoleRequestList{} if err := K8sClient.List(goCtx, wcrObjectList, ctrlruntime.InNamespace(namespace), labelSelector); err != nil { return false, err } diff --git a/pkg/webconsolevalidation/server_test.go b/pkg/webconsolevalidation/server_test.go index 19d012338..1e764becc 100644 --- a/pkg/webconsolevalidation/server_test.go +++ b/pkg/webconsolevalidation/server_test.go @@ -12,7 +12,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1" "github.com/vmware-tanzu/vm-operator/pkg/webconsolevalidation" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -55,7 +55,7 @@ func serverUnitTests() { Context("requests with a uuid param set", func() { BeforeEach(func() { - wcr := &vmopv1.WebConsoleRequest{} + wcr := &vmopv1a1.WebConsoleRequest{} wcr.Namespace = "dummy-namespace" wcr.Labels = map[string]string{ v1alpha1.UUIDLabelKey: "dummy-uuid-1234", diff --git a/test/builder/fake.go b/test/builder/fake.go index 40b0fc868..0480a4555 100644 --- a/test/builder/fake.go +++ b/test/builder/fake.go @@ -20,8 +20,9 @@ import ( cnsv1alpha1 "github.com/vmware-tanzu/vm-operator/external/vsphere-csi-driver/pkg/syncer/cnsoperator/apis/cnsnodevmattachment/v1alpha1" cnsstoragev1 "github.com/vmware-tanzu/vm-operator/external/vsphere-csi-driver/pkg/syncer/cnsoperator/apis/storagepolicy/v1alpha1" - "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a2 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/record" ) @@ -40,18 +41,14 @@ func NewFakeClient(objs ...client.Object) client.Client { // resource type. func KnownObjectTypes() []client.Object { return []client.Object{ - &v1alpha1.VirtualMachine{}, - &v1alpha2.VirtualMachine{}, - &v1alpha1.VirtualMachineService{}, - &v1alpha2.VirtualMachineService{}, - &v1alpha1.VirtualMachineClass{}, - &v1alpha2.VirtualMachineClass{}, - &v1alpha1.VirtualMachinePublishRequest{}, - &v1alpha2.VirtualMachinePublishRequest{}, - &v1alpha1.ClusterVirtualMachineImage{}, - &v1alpha2.ClusterVirtualMachineImage{}, - &v1alpha1.VirtualMachineImage{}, - &v1alpha2.VirtualMachineImage{}, + &vmopv1.VirtualMachine{}, + &vmopv1.VirtualMachineService{}, + &vmopv1.VirtualMachineClass{}, + &vmopv1.VirtualMachinePublishRequest{}, + &vmopv1.ClusterVirtualMachineImage{}, + &vmopv1.VirtualMachineImage{}, + &vmopv1.VirtualMachineWebConsoleRequest{}, + &vmopv1a1.WebConsoleRequest{}, &cnsv1alpha1.CnsNodeVmAttachment{}, &cnsstoragev1.StoragePolicyQuota{}, &ncpv1alpha1.VirtualNetworkInterface{}, @@ -71,8 +68,9 @@ func NewFakeRecorder() (record.Recorder, chan string) { func NewScheme() *runtime.Scheme { scheme := runtime.NewScheme() _ = clientgoscheme.AddToScheme(scheme) - _ = v1alpha1.AddToScheme(scheme) - _ = v1alpha2.AddToScheme(scheme) + _ = vmopv1a1.AddToScheme(scheme) + _ = vmopv1a2.AddToScheme(scheme) + _ = vmopv1.AddToScheme(scheme) _ = ncpv1alpha1.AddToScheme(scheme) _ = cnsapis.AddToScheme(scheme) _ = netopv1alpha1.AddToScheme(scheme) diff --git a/test/builder/test_suite.go b/test/builder/test_suite.go index bd4312086..791064ff0 100644 --- a/test/builder/test_suite.go +++ b/test/builder/test_suite.go @@ -41,7 +41,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/webhook" "sigs.k8s.io/yaml" - vmopv1alpha2 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" "github.com/vmware-tanzu/vm-operator/controllers/util/remote" "github.com/vmware-tanzu/vm-operator/pkg/builder" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" @@ -344,8 +343,6 @@ func (s *TestSuite) createManager() { } opts.Scheme = runtime.NewScheme() - _ = vmopv1alpha2.AddToScheme(opts.Scheme) - s.manager, err = pkgmgr.New(s, opts) Expect(err).NotTo(HaveOccurred()) diff --git a/test/builder/util.go b/test/builder/util.go index 78d738ebc..697b0b636 100644 --- a/test/builder/util.go +++ b/test/builder/util.go @@ -29,7 +29,7 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" topologyv1 "github.com/vmware-tanzu/vm-operator/external/tanzu-topology/api/v1alpha1" cnsstoragev1 "github.com/vmware-tanzu/vm-operator/external/vsphere-csi-driver/pkg/syncer/cnsoperator/apis/storagepolicy/v1alpha1" ) @@ -93,13 +93,13 @@ func DummyNamedAvailabilityZone(name string) *topologyv1.AvailabilityZone { } } -func DummyWebConsoleRequest(namespace, wcrName, vmName, pubKey string) *vmopv1.WebConsoleRequest { - return &vmopv1.WebConsoleRequest{ +func DummyWebConsoleRequest(namespace, wcrName, vmName, pubKey string) *vmopv1a1.WebConsoleRequest { + return &vmopv1a1.WebConsoleRequest{ ObjectMeta: metav1.ObjectMeta{ Name: wcrName, Namespace: namespace, }, - Spec: vmopv1.WebConsoleRequestSpec{ + Spec: vmopv1a1.WebConsoleRequestSpec{ VirtualMachineName: vmName, PublicKey: pubKey, }, diff --git a/test/builder/utila2.go b/test/builder/utila2.go index 776c0874f..d57a73798 100644 --- a/test/builder/utila2.go +++ b/test/builder/utila2.go @@ -11,7 +11,7 @@ import ( "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" ) func DummyVirtualMachineClass2A2(name string) *vmopv1.VirtualMachineClass { diff --git a/test/builder/vcsim_test_context.go b/test/builder/vcsim_test_context.go index af73ad75b..b0cfaa44c 100644 --- a/test/builder/vcsim_test_context.go +++ b/test/builder/vcsim_test_context.go @@ -45,7 +45,8 @@ import ( topologyv1 "github.com/vmware-tanzu/vm-operator/external/tanzu-topology/api/v1alpha1" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/conditions" "github.com/vmware-tanzu/vm-operator/pkg/record" "github.com/vmware-tanzu/vm-operator/test/testutil" @@ -424,10 +425,12 @@ func (c *TestContextForVCSim) setupContentLibrary(config VCSimTestConfig) { // The image isn't quite as prod but sufficient for what we need here ATM. clusterVMImage := DummyClusterVirtualMachineImageA2(c.ContentLibraryImageName) - clusterVMImage.Spec.ProviderRef.Kind = "ClusterContentLibraryItem" + clusterVMImage.Spec.ProviderRef = &common.LocalObjectRef{ + Kind: "ClusterContentLibraryItem", + } Expect(c.Client.Create(c, clusterVMImage)).To(Succeed()) clusterVMImage.Status.ProviderItemID = itemID - conditions.MarkTrue(clusterVMImage, v1alpha2.ReadyConditionType) + conditions.MarkTrue(clusterVMImage, vmopv1.ReadyConditionType) Expect(c.Client.Status().Update(c, clusterVMImage)).To(Succeed()) } @@ -462,7 +465,7 @@ func (c *TestContextForVCSim) ContentLibraryItemTemplate(srcVMName, templateName clusterVMImage.Spec.ProviderRef.Kind = "ClusterContentLibraryItem" Expect(c.Client.Create(c, clusterVMImage)).To(Succeed()) clusterVMImage.Status.ProviderItemID = itemID - conditions.MarkTrue(clusterVMImage, v1alpha2.ReadyConditionType) + conditions.MarkTrue(clusterVMImage, vmopv1.ReadyConditionType) Expect(c.Client.Status().Update(c, clusterVMImage)).To(Succeed()) } @@ -646,7 +649,7 @@ func (c *TestContextForVCSim) GetAZClusterComputes(azName string) []*object.Clus func (c *TestContextForVCSim) CreateVirtualMachineSetResourcePolicyA2( name string, - nsInfo WorkloadNamespaceInfo) (*v1alpha2.VirtualMachineSetResourcePolicy, *object.Folder) { + nsInfo WorkloadNamespaceInfo) (*vmopv1.VirtualMachineSetResourcePolicy, *object.Folder) { resourcePolicy := DummyVirtualMachineSetResourcePolicy2A2(name, nsInfo.Namespace) Expect(c.Client.Create(c, resourcePolicy)).To(Succeed()) diff --git a/webhooks/common/response_test.go b/webhooks/common/response_test.go index 6624064ec..0c29a52a0 100644 --- a/webhooks/common/response_test.go +++ b/webhooks/common/response_test.go @@ -13,7 +13,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" ctrllog "sigs.k8s.io/controller-runtime/pkg/log" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -24,13 +24,13 @@ var _ = Describe( "Validation Response", Label( testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Webhook, ), func() { var ( - gr = schema.GroupResource{Group: vmopv1.SchemeGroupVersion.Group, Resource: "VirtualMachine"} + gr = schema.GroupResource{Group: vmopv1a1.SchemeGroupVersion.Group, Resource: "VirtualMachine"} ctx *context.WebhookRequestContext ) diff --git a/webhooks/persistentvolumeclaim/validation/persistentvolumeclaim_validator.go b/webhooks/persistentvolumeclaim/validation/persistentvolumeclaim_validator.go index 9f55756ac..a2648813a 100644 --- a/webhooks/persistentvolumeclaim/validation/persistentvolumeclaim_validator.go +++ b/webhooks/persistentvolumeclaim/validation/persistentvolumeclaim_validator.go @@ -21,7 +21,7 @@ import ( "github.com/vmware-tanzu/vm-operator/pkg/builder" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" "github.com/vmware-tanzu/vm-operator/webhooks/common" ) diff --git a/webhooks/persistentvolumeclaim/validation/persistentvolumeclaim_validator_intg_test.go b/webhooks/persistentvolumeclaim/validation/persistentvolumeclaim_validator_intg_test.go index fa7e57754..001ec8aff 100644 --- a/webhooks/persistentvolumeclaim/validation/persistentvolumeclaim_validator_intg_test.go +++ b/webhooks/persistentvolumeclaim/validation/persistentvolumeclaim_validator_intg_test.go @@ -19,7 +19,7 @@ func intgTests() { Label( testlabels.Create, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -30,7 +30,7 @@ func intgTests() { Label( testlabels.Update, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -41,7 +41,7 @@ func intgTests() { Label( testlabels.Delete, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), diff --git a/webhooks/persistentvolumeclaim/validation/persistentvolumeclaim_validator_unit_test.go b/webhooks/persistentvolumeclaim/validation/persistentvolumeclaim_validator_unit_test.go index a6edbbd18..624b33955 100644 --- a/webhooks/persistentvolumeclaim/validation/persistentvolumeclaim_validator_unit_test.go +++ b/webhooks/persistentvolumeclaim/validation/persistentvolumeclaim_validator_unit_test.go @@ -12,7 +12,7 @@ import ( "k8s.io/apimachinery/pkg/util/validation/field" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/constants" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/constants" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -29,7 +29,7 @@ func unitTests() { "Create", Label( testlabels.Create, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -39,7 +39,7 @@ func unitTests() { "Update", Label( testlabels.Update, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -49,7 +49,7 @@ func unitTests() { "Delete", Label( testlabels.Delete, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), diff --git a/webhooks/virtualmachine/v1alpha2/mutation/virtualmachine_mutator.go b/webhooks/virtualmachine/mutation/virtualmachine_mutator.go similarity index 91% rename from webhooks/virtualmachine/v1alpha2/mutation/virtualmachine_mutator.go rename to webhooks/virtualmachine/mutation/virtualmachine_mutator.go index e14821ca4..02f68d710 100644 --- a/webhooks/virtualmachine/v1alpha2/mutation/virtualmachine_mutator.go +++ b/webhooks/virtualmachine/mutation/virtualmachine_mutator.go @@ -28,13 +28,13 @@ import ( netopv1alpha1 "github.com/vmware-tanzu/vm-operator/external/net-operator/api/v1alpha1" "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/builder" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/constants" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/config" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/config" ) const ( @@ -43,7 +43,7 @@ const ( defaultNamedNetwork = "VM Network" ) -// +kubebuilder:webhook:path=/default-mutate-vmoperator-vmware-com-v1alpha2-virtualmachine,mutating=true,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachines,verbs=create;update,versions=v1alpha2,name=default.mutating.virtualmachine.v1alpha2.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:path=/default-mutate-vmoperator-vmware-com-v1alpha3-virtualmachine,mutating=true,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachines,verbs=create;update,versions=v1alpha3,name=default.mutating.virtualmachine.v1alpha3.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachines,verbs=get;list // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachines/status,verbs=get // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachineimages,verbs=get;list;watch @@ -241,22 +241,37 @@ func AddDefaultNetworkInterface(ctx *context.WebhookRequestContext, client clien vm.Spec.Network.Interfaces = []vmopv1.VirtualMachineNetworkInterfaceSpec{ { Name: defaultInterfaceName, - Network: networkRef, + Network: &networkRef, }, } updated = true } else { for i := range vm.Spec.Network.Interfaces { - ifaceNetwork := &vm.Spec.Network.Interfaces[i].Network + ifaceNetwork := vm.Spec.Network.Interfaces[i].Network + + if networkRef.Kind != "" && ifaceNetwork == nil { + ifaceNetwork = &common.PartialObjectRef{ + TypeMeta: metav1.TypeMeta{ + APIVersion: networkRef.APIVersion, + Kind: networkRef.Kind, + }, + } + vm.Spec.Network.Interfaces[i].Network = ifaceNetwork + updated = true - if networkRef.Kind != "" && ifaceNetwork.Kind == "" && ifaceNetwork.APIVersion == "" { + } else if networkRef.Kind != "" && ifaceNetwork.Kind == "" && ifaceNetwork.APIVersion == "" { ifaceNetwork.Kind = networkRef.Kind ifaceNetwork.APIVersion = networkRef.APIVersion updated = true } - if networkRef.Name != "" && ifaceNetwork.Name == "" { - // Named network only. + // Named network only. + if networkRef.Kind != "" && ifaceNetwork == nil { + ifaceNetwork = &common.PartialObjectRef{ + Name: networkRef.Name, + } + vm.Spec.Network.Interfaces[i].Network = ifaceNetwork + } else if networkRef.Name != "" && ifaceNetwork.Name == "" { ifaceNetwork.Name = networkRef.Name updated = true } diff --git a/webhooks/virtualmachine/v1alpha2/mutation/virtualmachine_mutator_intg_test.go b/webhooks/virtualmachine/mutation/virtualmachine_mutator_intg_test.go similarity index 99% rename from webhooks/virtualmachine/v1alpha2/mutation/virtualmachine_mutator_intg_test.go rename to webhooks/virtualmachine/mutation/virtualmachine_mutator_intg_test.go index 3568e7132..db19a4ff5 100644 --- a/webhooks/virtualmachine/v1alpha2/mutation/virtualmachine_mutator_intg_test.go +++ b/webhooks/virtualmachine/mutation/virtualmachine_mutator_intg_test.go @@ -12,7 +12,7 @@ import ( "k8s.io/apimachinery/pkg/util/validation/field" "sigs.k8s.io/controller-runtime/pkg/client" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/constants" @@ -28,7 +28,7 @@ func intgTests() { testlabels.Update, testlabels.Delete, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Mutation, testlabels.Webhook, ), diff --git a/webhooks/virtualmachine/v1alpha2/mutation/virtualmachine_mutator_suite_test.go b/webhooks/virtualmachine/mutation/virtualmachine_mutator_suite_test.go similarity index 88% rename from webhooks/virtualmachine/v1alpha2/mutation/virtualmachine_mutator_suite_test.go rename to webhooks/virtualmachine/mutation/virtualmachine_mutator_suite_test.go index fbd7ca0fc..0c47d958a 100644 --- a/webhooks/virtualmachine/v1alpha2/mutation/virtualmachine_mutator_suite_test.go +++ b/webhooks/virtualmachine/mutation/virtualmachine_mutator_suite_test.go @@ -10,7 +10,7 @@ import ( pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/test/builder" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/v1alpha2/mutation" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/mutation" ) // suite is used for unit and integration testing this webhook. @@ -21,7 +21,7 @@ var suite = builder.NewTestSuiteForMutatingWebhookWithContext( }), mutation.AddToManager, mutation.NewMutator, - "default.mutating.virtualmachine.v1alpha2.vmoperator.vmware.com") + "default.mutating.virtualmachine.v1alpha3.vmoperator.vmware.com") func TestWebhook(t *testing.T) { suite.Register(t, "Mutating webhook suite", intgTests, uniTests) diff --git a/webhooks/virtualmachine/v1alpha2/mutation/virtualmachine_mutator_unit_test.go b/webhooks/virtualmachine/mutation/virtualmachine_mutator_unit_test.go similarity index 96% rename from webhooks/virtualmachine/v1alpha2/mutation/virtualmachine_mutator_unit_test.go rename to webhooks/virtualmachine/mutation/virtualmachine_mutator_unit_test.go index 21644fa69..7f75a8ba9 100644 --- a/webhooks/virtualmachine/v1alpha2/mutation/virtualmachine_mutator_unit_test.go +++ b/webhooks/virtualmachine/mutation/virtualmachine_mutator_unit_test.go @@ -16,14 +16,14 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/constants" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/config" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/config" "github.com/vmware-tanzu/vm-operator/test/builder" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/v1alpha2/mutation" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/mutation" ) func uniTests() { @@ -33,7 +33,7 @@ func uniTests() { testlabels.Create, testlabels.Update, testlabels.Delete, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Mutation, testlabels.Webhook, ), @@ -96,6 +96,7 @@ func unitTestsMutating() { Expect(mutation.AddDefaultNetworkInterface(&ctx.WebhookRequestContext, ctx.Client, ctx.vm)).To(BeTrue()) Expect(ctx.vm.Spec.Network.Interfaces).Should(HaveLen(1)) Expect(ctx.vm.Spec.Network.Interfaces[0].Name).Should(Equal("eth0")) + Expect(ctx.vm.Spec.Network.Interfaces[0].Network).ShouldNot(BeNil()) Expect(ctx.vm.Spec.Network.Interfaces[0].Network.Kind).Should(Equal("Network")) Expect(ctx.vm.Spec.Network.Interfaces[0].Network.APIVersion).Should(Equal("netoperator.vmware.com/v1alpha1")) }) @@ -118,6 +119,7 @@ func unitTestsMutating() { Expect(mutation.AddDefaultNetworkInterface(&ctx.WebhookRequestContext, ctx.Client, ctx.vm)).To(BeTrue()) Expect(ctx.vm.Spec.Network.Interfaces).Should(HaveLen(1)) Expect(ctx.vm.Spec.Network.Interfaces[0].Name).Should(Equal("eth0")) + Expect(ctx.vm.Spec.Network.Interfaces[0].Network).ShouldNot(BeNil()) Expect(ctx.vm.Spec.Network.Interfaces[0].Network.Kind).Should(Equal("Network")) Expect(ctx.vm.Spec.Network.Interfaces[0].Network.APIVersion).Should(Equal("netoperator.vmware.com/v1alpha1")) }) @@ -134,6 +136,7 @@ func unitTestsMutating() { Expect(mutation.AddDefaultNetworkInterface(&ctx.WebhookRequestContext, ctx.Client, ctx.vm)).To(BeTrue()) Expect(ctx.vm.Spec.Network.Interfaces).Should(HaveLen(1)) Expect(ctx.vm.Spec.Network.Interfaces[0].Name).Should(Equal("eth0")) + Expect(ctx.vm.Spec.Network.Interfaces[0].Network).ShouldNot(BeNil()) Expect(ctx.vm.Spec.Network.Interfaces[0].Network.Kind).Should(Equal("VirtualNetwork")) Expect(ctx.vm.Spec.Network.Interfaces[0].Network.APIVersion).Should(Equal("vmware.com/v1alpha1")) }) @@ -150,6 +153,7 @@ func unitTestsMutating() { Expect(mutation.AddDefaultNetworkInterface(&ctx.WebhookRequestContext, ctx.Client, ctx.vm)).To(BeTrue()) Expect(ctx.vm.Spec.Network.Interfaces).Should(HaveLen(1)) Expect(ctx.vm.Spec.Network.Interfaces[0].Name).Should(Equal("eth0")) + Expect(ctx.vm.Spec.Network.Interfaces[0].Network).ShouldNot(BeNil()) Expect(ctx.vm.Spec.Network.Interfaces[0].Network.Kind).Should(Equal("SubnetSet")) Expect(ctx.vm.Spec.Network.Interfaces[0].Network.APIVersion).Should(Equal("nsx.vmware.com/v1alpha1")) }) @@ -176,6 +180,7 @@ func unitTestsMutating() { Expect(mutation.AddDefaultNetworkInterface(&ctx.WebhookRequestContext, ctx.Client, ctx.vm)).To(BeTrue()) Expect(ctx.vm.Spec.Network.Interfaces).To(HaveLen(1)) + Expect(ctx.vm.Spec.Network.Interfaces[0].Network).ShouldNot(BeNil()) Expect(ctx.vm.Spec.Network.Interfaces[0].Network.Kind).To(BeEmpty()) Expect(ctx.vm.Spec.Network.Interfaces[0].Network.APIVersion).To(BeEmpty()) Expect(ctx.vm.Spec.Network.Interfaces[0].Network.Name).To(Equal(networkName)) @@ -213,7 +218,7 @@ func unitTestsMutating() { }, { Name: "eth1", - Network: common.PartialObjectRef{ + Network: &common.PartialObjectRef{ Name: "do-not-change-this-network-name", }, }, @@ -225,11 +230,13 @@ func unitTestsMutating() { Expect(ctx.vm.Spec.Network.Interfaces).To(HaveLen(2)) iface0 := &ctx.vm.Spec.Network.Interfaces[0] Expect(iface0.Name).To(Equal("eth0")) + Expect(iface0.Network).ToNot(BeNil()) Expect(iface0.Network.Name).To(BeEmpty()) Expect(iface0.Network.Kind).To(Equal("Network")) Expect(iface0.Network.APIVersion).To(Equal("netoperator.vmware.com/v1alpha1")) iface1 := &ctx.vm.Spec.Network.Interfaces[1] Expect(iface1.Name).To(Equal("eth1")) + Expect(iface1.Network).ToNot(BeNil()) Expect(iface1.Network.Name).To(Equal("do-not-change-this-network-name")) Expect(iface1.Network.Kind).To(Equal("Network")) Expect(iface1.Network.APIVersion).To(Equal("netoperator.vmware.com/v1alpha1")) diff --git a/webhooks/virtualmachine/v1alpha2/webhooks.go b/webhooks/virtualmachine/v1alpha2/webhooks.go deleted file mode 100644 index 5748f73e9..000000000 --- a/webhooks/virtualmachine/v1alpha2/webhooks.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2019-2023 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package v1alpha2 - -import ( - "github.com/pkg/errors" - ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/v1alpha2/mutation" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/v1alpha2/validation" -) - -func AddToManager(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager) error { - if err := validation.AddToManager(ctx, mgr); err != nil { - return errors.Wrap(err, "failed to initialize validation webhook") - } - if err := mutation.AddToManager(ctx, mgr); err != nil { - return errors.Wrap(err, "failed to initialize mutation webhook") - } - return nil -} diff --git a/webhooks/virtualmachine/v1alpha2/validation/virtualmachine_validator.go b/webhooks/virtualmachine/validation/virtualmachine_validator.go similarity index 98% rename from webhooks/virtualmachine/v1alpha2/validation/virtualmachine_validator.go rename to webhooks/virtualmachine/validation/virtualmachine_validator.go index 4800c40df..f729faf4d 100644 --- a/webhooks/virtualmachine/v1alpha2/validation/virtualmachine_validator.go +++ b/webhooks/virtualmachine/validation/virtualmachine_validator.go @@ -30,8 +30,8 @@ import ( cnsstoragev1 "github.com/vmware-tanzu/vm-operator/external/vsphere-csi-driver/pkg/syncer/cnsoperator/apis/storagepolicy/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/sysprep" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/sysprep" "github.com/vmware-tanzu/vm-operator/pkg/builder" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/constants" @@ -39,8 +39,8 @@ import ( "github.com/vmware-tanzu/vm-operator/pkg/topology" "github.com/vmware-tanzu/vm-operator/pkg/util" cloudinitvalidate "github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit/validate" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/config" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/instancestorage" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/config" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/instancestorage" "github.com/vmware-tanzu/vm-operator/webhooks/common" ) @@ -70,7 +70,7 @@ const ( invalidMinHardwareVersionPowerState = "cannot upgrade hardware version unless powered off" ) -// +kubebuilder:webhook:verbs=create;update,path=/default-validate-vmoperator-vmware-com-v1alpha2-virtualmachine,mutating=false,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachines,versions=v1alpha2,name=default.validating.virtualmachine.v1alpha2.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/default-validate-vmoperator-vmware-com-v1alpha3-virtualmachine,mutating=false,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachines,versions=v1alpha3,name=default.validating.virtualmachine.v1alpha3.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachines,verbs=get;list // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachines/status,verbs=get @@ -442,7 +442,11 @@ func (v validator) validateNetworkInterfaceSpec( var allErrs field.ErrorList var networkIfCRName string - networkName := interfaceSpec.Network.Name + var networkName string + + if interfaceSpec.Network != nil { + networkName = interfaceSpec.Network.Name + } // The networkInterface CR name ("vmName-networkName-interfaceName" or "vmName-interfaceName") needs to be a DNS1123 Label if networkName != "" { @@ -1006,7 +1010,7 @@ func (v validator) validateImmutableNetwork(ctx *context.WebhookRequestContext, if newInterface.Name != oldInterface.Name { allErrs = append(allErrs, field.Forbidden(pi.Child("name"), validation.FieldImmutableErrorMsg)) } - if !reflect.DeepEqual(&newInterface.Network, &oldInterface.Network) { + if !reflect.DeepEqual(newInterface.Network, oldInterface.Network) { allErrs = append(allErrs, field.Forbidden(pi.Child("network"), validation.FieldImmutableErrorMsg)) } } diff --git a/webhooks/virtualmachine/v1alpha2/validation/virtualmachine_validator_intg_test.go b/webhooks/virtualmachine/validation/virtualmachine_validator_intg_test.go similarity index 97% rename from webhooks/virtualmachine/v1alpha2/validation/virtualmachine_validator_intg_test.go rename to webhooks/virtualmachine/validation/virtualmachine_validator_intg_test.go index fe097725c..150a4c405 100644 --- a/webhooks/virtualmachine/v1alpha2/validation/virtualmachine_validator_intg_test.go +++ b/webhooks/virtualmachine/validation/virtualmachine_validator_intg_test.go @@ -10,8 +10,8 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/validation/field" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -22,7 +22,7 @@ func intgTests() { Label( testlabels.Create, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -33,7 +33,7 @@ func intgTests() { Label( testlabels.Update, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -44,7 +44,7 @@ func intgTests() { Label( testlabels.Delete, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), diff --git a/webhooks/virtualmachine/v1alpha2/validation/virtualmachine_validator_suite_test.go b/webhooks/virtualmachine/validation/virtualmachine_validator_suite_test.go similarity index 82% rename from webhooks/virtualmachine/v1alpha2/validation/virtualmachine_validator_suite_test.go rename to webhooks/virtualmachine/validation/virtualmachine_validator_suite_test.go index 34a3ab8d5..161593ed1 100644 --- a/webhooks/virtualmachine/v1alpha2/validation/virtualmachine_validator_suite_test.go +++ b/webhooks/virtualmachine/validation/virtualmachine_validator_suite_test.go @@ -10,7 +10,7 @@ import ( pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/test/builder" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/v1alpha2/validation" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/validation" ) // suite is used for unit and integration testing this webhook. @@ -18,7 +18,7 @@ var suite = builder.NewTestSuiteForValidatingWebhookWithContext( pkgconfig.NewContext(), validation.AddToManager, validation.NewValidator, - "default.validating.virtualmachine.v1alpha2.vmoperator.vmware.com") + "default.validating.virtualmachine.v1alpha3.vmoperator.vmware.com") func TestWebhook(t *testing.T) { suite.Register(t, "Validation webhook suite", intgTests, unitTests) diff --git a/webhooks/virtualmachine/v1alpha2/validation/virtualmachine_validator_unit_test.go b/webhooks/virtualmachine/validation/virtualmachine_validator_unit_test.go similarity index 99% rename from webhooks/virtualmachine/v1alpha2/validation/virtualmachine_validator_unit_test.go rename to webhooks/virtualmachine/validation/virtualmachine_validator_unit_test.go index b5fabd9f9..5a234da6d 100644 --- a/webhooks/virtualmachine/v1alpha2/validation/virtualmachine_validator_unit_test.go +++ b/webhooks/virtualmachine/validation/virtualmachine_validator_unit_test.go @@ -21,16 +21,16 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/cloudinit" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/common" - "github.com/vmware-tanzu/vm-operator/api/v1alpha2/sysprep" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/cloudinit" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/common" + "github.com/vmware-tanzu/vm-operator/api/v1alpha3/sysprep" pkgbuilder "github.com/vmware-tanzu/vm-operator/pkg/builder" pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/constants" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/pkg/topology" - "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/config" + "github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/config" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -65,7 +65,7 @@ func unitTests() { "Create", Label( testlabels.Create, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -75,7 +75,7 @@ func unitTests() { "Update", Label( testlabels.Update, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -85,7 +85,7 @@ func unitTests() { "Delete", Label( testlabels.Delete, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -1349,13 +1349,13 @@ func unitTestsValidateCreate() { Interfaces: []vmopv1.VirtualMachineNetworkInterfaceSpec{ { Name: fmt.Sprintf("%x", make([]byte, validation.DNS1123SubdomainMaxLength)), - Network: common.PartialObjectRef{ + Network: &common.PartialObjectRef{ Name: "dummy-nw", }, }, { Name: "dummy_If", - Network: common.PartialObjectRef{ + Network: &common.PartialObjectRef{ Name: "dummy-nw", }, }, @@ -1750,7 +1750,7 @@ func unitTestsValidateUpdate() { Interfaces: []vmopv1.VirtualMachineNetworkInterfaceSpec{ { Name: "eth0", - Network: common.PartialObjectRef{Name: "my-network"}, + Network: &common.PartialObjectRef{Name: "my-network"}, }, }, } diff --git a/webhooks/virtualmachine/webhooks.go b/webhooks/virtualmachine/webhooks.go index d8601f3c3..d1530b3e5 100644 --- a/webhooks/virtualmachine/webhooks.go +++ b/webhooks/virtualmachine/webhooks.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2019-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package virtualmachine @@ -7,9 +7,13 @@ import ( ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/v1alpha2" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/mutation" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/validation" ) func AddToManager(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager) error { - return v1alpha2.AddToManager(ctx, mgr) + if err := mutation.AddToManager(ctx, mgr); err != nil { + return err + } + return validation.AddToManager(ctx, mgr) } diff --git a/webhooks/virtualmachineclass/v1alpha2/mutation/virtualmachineclass_mutator.go b/webhooks/virtualmachineclass/mutation/virtualmachineclass_mutator.go similarity index 92% rename from webhooks/virtualmachineclass/v1alpha2/mutation/virtualmachineclass_mutator.go rename to webhooks/virtualmachineclass/mutation/virtualmachineclass_mutator.go index c2b3efbeb..6e52af54e 100644 --- a/webhooks/virtualmachineclass/v1alpha2/mutation/virtualmachineclass_mutator.go +++ b/webhooks/virtualmachineclass/mutation/virtualmachineclass_mutator.go @@ -16,7 +16,7 @@ import ( ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/builder" "github.com/vmware-tanzu/vm-operator/pkg/context" ) @@ -25,7 +25,7 @@ const ( webHookName = "default" ) -// -kubebuilder:webhook:path=/default-mutate-vmoperator-vmware-com-v1alpha2-virtualmachineclass,mutating=true,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachineclasses,verbs=create;update,versions=v1alpha2,name=default.mutating.virtualmachineclass.v1alpha2.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// -kubebuilder:webhook:path=/default-mutate-vmoperator-vmware-com-v1alpha3-virtualmachineclass,mutating=true,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachineclasses,verbs=create;update,versions=v1alpha3,name=default.mutating.virtualmachineclass.v1alpha3.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 // -kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachineclass,verbs=get;list // -kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachineclass/status,verbs=get diff --git a/webhooks/virtualmachineclass/v1alpha2/mutation/virtualmachineclass_mutator_intg_test.go b/webhooks/virtualmachineclass/mutation/virtualmachineclass_mutator_intg_test.go similarity index 94% rename from webhooks/virtualmachineclass/v1alpha2/mutation/virtualmachineclass_mutator_intg_test.go rename to webhooks/virtualmachineclass/mutation/virtualmachineclass_mutator_intg_test.go index 76ccd523b..9399cdfe3 100644 --- a/webhooks/virtualmachineclass/v1alpha2/mutation/virtualmachineclass_mutator_intg_test.go +++ b/webhooks/virtualmachineclass/mutation/virtualmachineclass_mutator_intg_test.go @@ -7,7 +7,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -20,7 +20,7 @@ func intgTests() { testlabels.Update, testlabels.Delete, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Mutation, testlabels.Webhook, ), diff --git a/webhooks/virtualmachineclass/v1alpha2/mutation/virtualmachineclass_mutator_suite_test.go b/webhooks/virtualmachineclass/mutation/virtualmachineclass_mutator_suite_test.go similarity index 89% rename from webhooks/virtualmachineclass/v1alpha2/mutation/virtualmachineclass_mutator_suite_test.go rename to webhooks/virtualmachineclass/mutation/virtualmachineclass_mutator_suite_test.go index e3395f147..198c077e7 100644 --- a/webhooks/virtualmachineclass/v1alpha2/mutation/virtualmachineclass_mutator_suite_test.go +++ b/webhooks/virtualmachineclass/mutation/virtualmachineclass_mutator_suite_test.go @@ -10,7 +10,7 @@ import ( pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/test/builder" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/v1alpha2/mutation" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/mutation" ) // suite is used for unit and integration testing this webhook. @@ -18,7 +18,7 @@ var suite = builder.NewTestSuiteForMutatingWebhookWithContext( pkgconfig.NewContext(), mutation.AddToManager, mutation.NewMutator, - "default.mutating.virtualmachineclass.v1alpha2.vmoperator.vmware.com") + "default.mutating.virtualmachineclass.v1alpha3.vmoperator.vmware.com") func TestWebhook(t *testing.T) { suite.Register(t, "Mutating webhook suite", intgTests, uniTests) diff --git a/webhooks/virtualmachineclass/v1alpha2/mutation/virtualmachineclass_mutator_unit_test.go b/webhooks/virtualmachineclass/mutation/virtualmachineclass_mutator_unit_test.go similarity index 96% rename from webhooks/virtualmachineclass/v1alpha2/mutation/virtualmachineclass_mutator_unit_test.go rename to webhooks/virtualmachineclass/mutation/virtualmachineclass_mutator_unit_test.go index 062c0f1de..3cafc46d8 100644 --- a/webhooks/virtualmachineclass/v1alpha2/mutation/virtualmachineclass_mutator_unit_test.go +++ b/webhooks/virtualmachineclass/mutation/virtualmachineclass_mutator_unit_test.go @@ -9,10 +9,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/v1alpha2/mutation" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/mutation" ) func uniTests() { @@ -22,7 +22,7 @@ func uniTests() { testlabels.Create, testlabels.Update, testlabels.Delete, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Mutation, testlabels.Webhook, ), diff --git a/webhooks/virtualmachineclass/v1alpha2/webhooks.go b/webhooks/virtualmachineclass/v1alpha2/webhooks.go deleted file mode 100644 index 226641b85..000000000 --- a/webhooks/virtualmachineclass/v1alpha2/webhooks.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2019-2023 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package v1alpha2 - -import ( - "github.com/pkg/errors" - ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/v1alpha2/mutation" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/v1alpha2/validation" -) - -func AddToManager(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager) error { - if err := validation.AddToManager(ctx, mgr); err != nil { - return errors.Wrap(err, "failed to initialize validation webhook") - } - if err := mutation.AddToManager(ctx, mgr); err != nil { - return errors.Wrap(err, "failed to initialize mutation webhook") - } - return nil -} diff --git a/webhooks/virtualmachineclass/v1alpha2/validation/virtualmachineclass_validator.go b/webhooks/virtualmachineclass/validation/virtualmachineclass_validator.go similarity index 94% rename from webhooks/virtualmachineclass/v1alpha2/validation/virtualmachineclass_validator.go rename to webhooks/virtualmachineclass/validation/virtualmachineclass_validator.go index 14aee640d..838842c44 100644 --- a/webhooks/virtualmachineclass/v1alpha2/validation/virtualmachineclass_validator.go +++ b/webhooks/virtualmachineclass/validation/virtualmachineclass_validator.go @@ -19,7 +19,7 @@ import ( "github.com/pkg/errors" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/builder" "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -33,7 +33,7 @@ const ( invalidMemoryReqMsg = "memory request must not be larger than the memory limit" ) -// +kubebuilder:webhook:verbs=create;update,path=/default-validate-vmoperator-vmware-com-v1alpha2-virtualmachineclass,mutating=false,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachineclasses,versions=v1alpha2,name=default.validating.virtualmachineclass.v1alpha2.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/default-validate-vmoperator-vmware-com-v1alpha3-virtualmachineclass,mutating=false,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachineclasses,versions=v1alpha3,name=default.validating.virtualmachineclass.v1alpha3.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachineclasses,verbs=get;list // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachineclasses/status,verbs=get diff --git a/webhooks/virtualmachineclass/v1alpha2/validation/virtualmachineclass_validator_intg_test.go b/webhooks/virtualmachineclass/validation/virtualmachineclass_validator_intg_test.go similarity index 96% rename from webhooks/virtualmachineclass/v1alpha2/validation/virtualmachineclass_validator_intg_test.go rename to webhooks/virtualmachineclass/validation/virtualmachineclass_validator_intg_test.go index aa1e54a0d..d0bdfba58 100644 --- a/webhooks/virtualmachineclass/v1alpha2/validation/virtualmachineclass_validator_intg_test.go +++ b/webhooks/virtualmachineclass/validation/virtualmachineclass_validator_intg_test.go @@ -10,7 +10,7 @@ import ( "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/util/validation/field" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -21,7 +21,7 @@ func intgTests() { Label( testlabels.Create, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -32,7 +32,7 @@ func intgTests() { Label( testlabels.Delete, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), diff --git a/webhooks/virtualmachineclass/v1alpha2/validation/virtualmachineclass_validator_suite_test.go b/webhooks/virtualmachineclass/validation/virtualmachineclass_validator_suite_test.go similarity index 89% rename from webhooks/virtualmachineclass/v1alpha2/validation/virtualmachineclass_validator_suite_test.go rename to webhooks/virtualmachineclass/validation/virtualmachineclass_validator_suite_test.go index 1b724af30..c421e8b87 100644 --- a/webhooks/virtualmachineclass/v1alpha2/validation/virtualmachineclass_validator_suite_test.go +++ b/webhooks/virtualmachineclass/validation/virtualmachineclass_validator_suite_test.go @@ -10,7 +10,7 @@ import ( pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/test/builder" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/v1alpha2/validation" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/validation" ) // suite is used for unit and integration testing this webhook. @@ -18,7 +18,7 @@ var suite = builder.NewTestSuiteForValidatingWebhookWithContext( pkgconfig.NewContext(), validation.AddToManager, validation.NewValidator, - "default.validating.virtualmachineclass.v1alpha2.vmoperator.vmware.com") + "default.validating.virtualmachineclass.v1alpha3.vmoperator.vmware.com") func TestWebhook(t *testing.T) { suite.Register(t, "Validation webhook suite", intgTests, unitTests) diff --git a/webhooks/virtualmachineclass/v1alpha2/validation/virtualmachineclass_validator_unit_test.go b/webhooks/virtualmachineclass/validation/virtualmachineclass_validator_unit_test.go similarity index 98% rename from webhooks/virtualmachineclass/v1alpha2/validation/virtualmachineclass_validator_unit_test.go rename to webhooks/virtualmachineclass/validation/virtualmachineclass_validator_unit_test.go index a1ac05efd..d4c2c6eff 100644 --- a/webhooks/virtualmachineclass/v1alpha2/validation/virtualmachineclass_validator_unit_test.go +++ b/webhooks/virtualmachineclass/validation/virtualmachineclass_validator_unit_test.go @@ -13,7 +13,7 @@ import ( "k8s.io/apimachinery/pkg/util/validation/field" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -24,7 +24,7 @@ func unitTests() { "Create", Label( testlabels.Create, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -34,7 +34,7 @@ func unitTests() { "Update", Label( testlabels.Update, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -44,7 +44,7 @@ func unitTests() { "Delete", Label( testlabels.Delete, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), diff --git a/webhooks/virtualmachineclass/webhooks.go b/webhooks/virtualmachineclass/webhooks.go index 58cb2361f..e7200b4bf 100644 --- a/webhooks/virtualmachineclass/webhooks.go +++ b/webhooks/virtualmachineclass/webhooks.go @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2019-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package virtualmachineclass @@ -7,9 +7,13 @@ import ( ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/v1alpha2" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/mutation" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/validation" ) func AddToManager(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager) error { - return v1alpha2.AddToManager(ctx, mgr) + if err := mutation.AddToManager(ctx, mgr); err != nil { + return err + } + return validation.AddToManager(ctx, mgr) } diff --git a/webhooks/virtualmachinepublishrequest/v1alpha2/webhooks.go b/webhooks/virtualmachinepublishrequest/v1alpha2/webhooks.go deleted file mode 100644 index 8c2581a5a..000000000 --- a/webhooks/virtualmachinepublishrequest/v1alpha2/webhooks.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2022-2023 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package v1alpha2 - -import ( - "github.com/pkg/errors" - ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinepublishrequest/v1alpha2/validation" -) - -func AddToManager(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager) error { - if err := validation.AddToManager(ctx, mgr); err != nil { - return errors.Wrap(err, "failed to initialize validation webhook") - } - return nil -} diff --git a/webhooks/virtualmachinepublishrequest/v1alpha2/validation/virtualmachinepublishrequest_validator.go b/webhooks/virtualmachinepublishrequest/validation/virtualmachinepublishrequest_validator.go similarity index 92% rename from webhooks/virtualmachinepublishrequest/v1alpha2/validation/virtualmachinepublishrequest_validator.go rename to webhooks/virtualmachinepublishrequest/validation/virtualmachinepublishrequest_validator.go index 5aca329d0..4373bfd52 100644 --- a/webhooks/virtualmachinepublishrequest/v1alpha2/validation/virtualmachinepublishrequest_validator.go +++ b/webhooks/virtualmachinepublishrequest/validation/virtualmachinepublishrequest_validator.go @@ -20,7 +20,8 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/builder" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/webhooks/common" @@ -30,7 +31,7 @@ const ( webHookName = "default" ) -// +kubebuilder:webhook:verbs=create;update,path=/default-validate-vmoperator-vmware-com-v1alpha2-virtualmachinepublishrequest,mutating=false,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachinepublishrequests,versions=v1alpha2,name=default.validating.virtualmachinepublishrequest.v1alpha2.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/default-validate-vmoperator-vmware-com-v1alpha3-virtualmachinepublishrequest,mutating=false,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachinepublishrequests,versions=v1alpha3,name=default.validating.virtualmachinepublishrequest.v1alpha3.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachinepublishrequests,verbs=get;list // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachinepublishrequests/status,verbs=get // +kubebuilder:rbac:groups=imageregistry.vmware.com,resources=contentlibraries,verbs=get;list; @@ -115,12 +116,12 @@ func (v validator) validateSource(ctx *context.WebhookRequestContext, vmpub *vmo sourcePath := field.NewPath("spec").Child("source") if apiVersion := vmpub.Spec.Source.APIVersion; apiVersion != "" { - v1a1GV, v1a2GV := v1alpha1.SchemeGroupVersion.String(), vmopv1.SchemeGroupVersion.String() + v1a1GV, v1a2GV, vmopv1 := v1alpha1.SchemeGroupVersion.String(), v1alpha2.SchemeGroupVersion.String(), vmopv1.SchemeGroupVersion.String() switch apiVersion { - case v1a1GV, v1a2GV: + case v1a1GV, v1a2GV, vmopv1: default: allErrs = append(allErrs, field.NotSupported(sourcePath.Child("apiVersion"), - apiVersion, []string{v1a1GV, v1a2GV, ""})) + apiVersion, []string{v1a1GV, v1a2GV, vmopv1, ""})) } } diff --git a/webhooks/virtualmachinepublishrequest/v1alpha2/validation/virtualmachinepublishrequest_validator_intg_test.go b/webhooks/virtualmachinepublishrequest/validation/virtualmachinepublishrequest_validator_intg_test.go similarity index 95% rename from webhooks/virtualmachinepublishrequest/v1alpha2/validation/virtualmachinepublishrequest_validator_intg_test.go rename to webhooks/virtualmachinepublishrequest/validation/virtualmachinepublishrequest_validator_intg_test.go index 565559d8a..cd4099a13 100644 --- a/webhooks/virtualmachinepublishrequest/v1alpha2/validation/virtualmachinepublishrequest_validator_intg_test.go +++ b/webhooks/virtualmachinepublishrequest/validation/virtualmachinepublishrequest_validator_intg_test.go @@ -7,7 +7,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -18,7 +18,7 @@ func intgTests() { Label( testlabels.Create, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -29,7 +29,7 @@ func intgTests() { Label( testlabels.Update, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -40,7 +40,7 @@ func intgTests() { Label( testlabels.Delete, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), diff --git a/webhooks/virtualmachinepublishrequest/v1alpha2/validation/virtualmachinepublishrequest_validator_suite_test.go b/webhooks/virtualmachinepublishrequest/validation/virtualmachinepublishrequest_validator_suite_test.go similarity index 88% rename from webhooks/virtualmachinepublishrequest/v1alpha2/validation/virtualmachinepublishrequest_validator_suite_test.go rename to webhooks/virtualmachinepublishrequest/validation/virtualmachinepublishrequest_validator_suite_test.go index 8a5f29720..0e3364027 100644 --- a/webhooks/virtualmachinepublishrequest/v1alpha2/validation/virtualmachinepublishrequest_validator_suite_test.go +++ b/webhooks/virtualmachinepublishrequest/validation/virtualmachinepublishrequest_validator_suite_test.go @@ -10,7 +10,7 @@ import ( pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/test/builder" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinepublishrequest/v1alpha2/validation" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinepublishrequest/validation" ) // suite is used for unit and integration testing this webhook. @@ -18,7 +18,7 @@ var suite = builder.NewTestSuiteForValidatingWebhookWithContext( pkgconfig.NewContext(), validation.AddToManager, validation.NewValidator, - "default.validating.virtualmachinepublishrequest.v1alpha2.vmoperator.vmware.com") + "default.validating.virtualmachinepublishrequest.v1alpha3.vmoperator.vmware.com") func TestWebhook(t *testing.T) { suite.Register(t, "Validation webhook suite", intgTests, unitTests) diff --git a/webhooks/virtualmachinepublishrequest/v1alpha2/validation/virtualmachinepublishrequest_validator_unit_test.go b/webhooks/virtualmachinepublishrequest/validation/virtualmachinepublishrequest_validator_unit_test.go similarity index 97% rename from webhooks/virtualmachinepublishrequest/v1alpha2/validation/virtualmachinepublishrequest_validator_unit_test.go rename to webhooks/virtualmachinepublishrequest/validation/virtualmachinepublishrequest_validator_unit_test.go index a32bd409b..b583bb11c 100644 --- a/webhooks/virtualmachinepublishrequest/v1alpha2/validation/virtualmachinepublishrequest_validator_unit_test.go +++ b/webhooks/virtualmachinepublishrequest/validation/virtualmachinepublishrequest_validator_unit_test.go @@ -13,8 +13,8 @@ import ( imgregv1a1 "github.com/vmware-tanzu/image-registry-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" - "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/utils" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" + "github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -24,7 +24,7 @@ func unitTests() { "Create", Label( testlabels.Create, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -34,7 +34,7 @@ func unitTests() { "Update", Label( testlabels.Update, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -44,7 +44,7 @@ func unitTests() { "Delete", Label( testlabels.Delete, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -182,7 +182,7 @@ func unitTestsValidateCreate() { Entry("should allow valid", createArgs{}, true, nil, nil), Entry("should deny invalid source API version", createArgs{invalidSourceAPIVersion: true}, false, field.NotSupported(sourcePath.Child("apiVersion"), invalidAPIVersion, - []string{"vmoperator.vmware.com/v1alpha1", "vmoperator.vmware.com/v1alpha2", ""}).Error(), nil), + []string{"vmoperator.vmware.com/v1alpha1", "vmoperator.vmware.com/v1alpha2", "vmoperator.vmware.com/v1alpha3", ""}).Error(), nil), Entry("should deny invalid source kind", createArgs{invalidSourceKind: true}, false, field.NotSupported(sourcePath.Child("kind"), "Machine", []string{"VirtualMachine", ""}).Error(), nil), diff --git a/webhooks/virtualmachinepublishrequest/webhooks.go b/webhooks/virtualmachinepublishrequest/webhooks.go index 570eb8c86..dd753631a 100644 --- a/webhooks/virtualmachinepublishrequest/webhooks.go +++ b/webhooks/virtualmachinepublishrequest/webhooks.go @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2023-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package virtualmachinepublishrequest @@ -7,9 +7,9 @@ import ( ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinepublishrequest/v1alpha2" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinepublishrequest/validation" ) func AddToManager(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager) error { - return v1alpha2.AddToManager(ctx, mgr) + return validation.AddToManager(ctx, mgr) } diff --git a/webhooks/virtualmachineservice/v1alpha2/mutation/virtualmachineservice_mutator.go b/webhooks/virtualmachineservice/mutation/virtualmachineservice_mutator.go similarity index 91% rename from webhooks/virtualmachineservice/v1alpha2/mutation/virtualmachineservice_mutator.go rename to webhooks/virtualmachineservice/mutation/virtualmachineservice_mutator.go index ac37c523b..b0fcc37b4 100644 --- a/webhooks/virtualmachineservice/v1alpha2/mutation/virtualmachineservice_mutator.go +++ b/webhooks/virtualmachineservice/mutation/virtualmachineservice_mutator.go @@ -15,7 +15,7 @@ import ( ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/builder" "github.com/vmware-tanzu/vm-operator/pkg/context" ) @@ -24,7 +24,7 @@ const ( webHookName = "default" ) -// -kubebuilder:webhook:path=/default-mutate-vmoperator-vmware-com-v1alpha2-virtualmachineservice,mutating=true,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachineservices,verbs=create;update,versions=v1alpha2,name=default.mutating.virtualmachineservice.v1alpha2.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// -kubebuilder:webhook:path=/default-mutate-vmoperator-vmware-com-v1alpha3-virtualmachineservice,mutating=true,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachineservices,verbs=create;update,versions=v1alpha3,name=default.mutating.virtualmachineservice.v1alpha3.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 // -kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachineservice,verbs=get;list // -kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachineservice/status,verbs=get diff --git a/webhooks/virtualmachineservice/v1alpha2/mutation/virtualmachineservice_mutator_intg_test.go b/webhooks/virtualmachineservice/mutation/virtualmachineservice_mutator_intg_test.go similarity index 94% rename from webhooks/virtualmachineservice/v1alpha2/mutation/virtualmachineservice_mutator_intg_test.go rename to webhooks/virtualmachineservice/mutation/virtualmachineservice_mutator_intg_test.go index b8fcbf9d3..99884fa76 100644 --- a/webhooks/virtualmachineservice/v1alpha2/mutation/virtualmachineservice_mutator_intg_test.go +++ b/webhooks/virtualmachineservice/mutation/virtualmachineservice_mutator_intg_test.go @@ -7,7 +7,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -21,7 +21,7 @@ func intgTests() { testlabels.Update, testlabels.Delete, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Mutation, testlabels.Webhook, ), diff --git a/webhooks/virtualmachineservice/v1alpha2/mutation/virtualmachineservice_mutator_suite_test.go b/webhooks/virtualmachineservice/mutation/virtualmachineservice_mutator_suite_test.go similarity index 89% rename from webhooks/virtualmachineservice/v1alpha2/mutation/virtualmachineservice_mutator_suite_test.go rename to webhooks/virtualmachineservice/mutation/virtualmachineservice_mutator_suite_test.go index 706601dac..f95cb452d 100644 --- a/webhooks/virtualmachineservice/v1alpha2/mutation/virtualmachineservice_mutator_suite_test.go +++ b/webhooks/virtualmachineservice/mutation/virtualmachineservice_mutator_suite_test.go @@ -10,7 +10,7 @@ import ( pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/test/builder" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/v1alpha2/mutation" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/mutation" ) // suite is used for unit and integration testing this webhook. @@ -18,7 +18,7 @@ var suite = builder.NewTestSuiteForMutatingWebhookWithContext( pkgconfig.NewContext(), mutation.AddToManager, mutation.NewMutator, - "default.mutating.virtualmachineservice.v1alpha2.vmoperator.vmware.com") + "default.mutating.virtualmachineservice.v1alpha3.vmoperator.vmware.com") func TestWebhook(t *testing.T) { suite.Register(t, "Mutating webhook suite", intgTests, uniTests) diff --git a/webhooks/virtualmachineservice/v1alpha2/mutation/virtualmachineservice_mutator_unit_test.go b/webhooks/virtualmachineservice/mutation/virtualmachineservice_mutator_unit_test.go similarity index 95% rename from webhooks/virtualmachineservice/v1alpha2/mutation/virtualmachineservice_mutator_unit_test.go rename to webhooks/virtualmachineservice/mutation/virtualmachineservice_mutator_unit_test.go index e57e07aac..1fb34c6ca 100644 --- a/webhooks/virtualmachineservice/v1alpha2/mutation/virtualmachineservice_mutator_unit_test.go +++ b/webhooks/virtualmachineservice/mutation/virtualmachineservice_mutator_unit_test.go @@ -8,7 +8,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -21,7 +21,7 @@ func uniTests() { testlabels.Create, testlabels.Update, testlabels.Delete, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Mutation, testlabels.Webhook, ), diff --git a/webhooks/virtualmachineservice/v1alpha2/webhooks.go b/webhooks/virtualmachineservice/v1alpha2/webhooks.go deleted file mode 100644 index 8403d7106..000000000 --- a/webhooks/virtualmachineservice/v1alpha2/webhooks.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package v1alpha2 - -import ( - "github.com/pkg/errors" - ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/v1alpha2/mutation" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/v1alpha2/validation" -) - -func AddToManager(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager) error { - if err := validation.AddToManager(ctx, mgr); err != nil { - return errors.Wrap(err, "failed to initialize validation webhook") - } - if err := mutation.AddToManager(ctx, mgr); err != nil { - return errors.Wrap(err, "failed to initialize mutation webhook") - } - return nil -} diff --git a/webhooks/virtualmachineservice/v1alpha2/validation/virtualmachineservice_validator.go b/webhooks/virtualmachineservice/validation/virtualmachineservice_validator.go similarity index 97% rename from webhooks/virtualmachineservice/v1alpha2/validation/virtualmachineservice_validator.go rename to webhooks/virtualmachineservice/validation/virtualmachineservice_validator.go index 1416dc781..caf9003c5 100644 --- a/webhooks/virtualmachineservice/v1alpha2/validation/virtualmachineservice_validator.go +++ b/webhooks/virtualmachineservice/validation/virtualmachineservice_validator.go @@ -24,7 +24,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/webhook" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/builder" "github.com/vmware-tanzu/vm-operator/pkg/context" "github.com/vmware-tanzu/vm-operator/webhooks/common" @@ -48,7 +48,7 @@ var ( ) ) -// +kubebuilder:webhook:verbs=create;update,path=/default-validate-vmoperator-vmware-com-v1alpha2-virtualmachineservice,mutating=false,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachineservices,versions=v1alpha2,name=default.validating.virtualmachineservice.v1alpha2.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/default-validate-vmoperator-vmware-com-v1alpha3-virtualmachineservice,mutating=false,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachineservices,versions=v1alpha3,name=default.validating.virtualmachineservice.v1alpha3.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachineservices,verbs=get;list // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachineservices/status,verbs=get diff --git a/webhooks/virtualmachineservice/v1alpha2/validation/virtualmachineservice_validator_intg_test.go b/webhooks/virtualmachineservice/validation/virtualmachineservice_validator_intg_test.go similarity index 95% rename from webhooks/virtualmachineservice/v1alpha2/validation/virtualmachineservice_validator_intg_test.go rename to webhooks/virtualmachineservice/validation/virtualmachineservice_validator_intg_test.go index d668cbf9f..2150115f9 100644 --- a/webhooks/virtualmachineservice/v1alpha2/validation/virtualmachineservice_validator_intg_test.go +++ b/webhooks/virtualmachineservice/validation/virtualmachineservice_validator_intg_test.go @@ -7,7 +7,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -18,7 +18,7 @@ func intgTests() { Label( testlabels.Create, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -29,7 +29,7 @@ func intgTests() { Label( testlabels.Update, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -40,7 +40,7 @@ func intgTests() { Label( testlabels.Delete, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), diff --git a/webhooks/virtualmachineservice/v1alpha2/validation/virtualmachineservice_validator_suite_test.go b/webhooks/virtualmachineservice/validation/virtualmachineservice_validator_suite_test.go similarity index 89% rename from webhooks/virtualmachineservice/v1alpha2/validation/virtualmachineservice_validator_suite_test.go rename to webhooks/virtualmachineservice/validation/virtualmachineservice_validator_suite_test.go index a21633f02..b9c83c047 100644 --- a/webhooks/virtualmachineservice/v1alpha2/validation/virtualmachineservice_validator_suite_test.go +++ b/webhooks/virtualmachineservice/validation/virtualmachineservice_validator_suite_test.go @@ -10,7 +10,7 @@ import ( pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/test/builder" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/v1alpha2/validation" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/validation" ) // suite is used for unit and integration testing this webhook. @@ -18,7 +18,7 @@ var suite = builder.NewTestSuiteForValidatingWebhookWithContext( pkgconfig.NewContext(), validation.AddToManager, validation.NewValidator, - "default.validating.virtualmachineservice.v1alpha2.vmoperator.vmware.com") + "default.validating.virtualmachineservice.v1alpha3.vmoperator.vmware.com") func TestWebhook(t *testing.T) { suite.Register(t, "Validation webhook suite", intgTests, unitTests) diff --git a/webhooks/virtualmachineservice/v1alpha2/validation/virtualmachineservice_validator_unit_test.go b/webhooks/virtualmachineservice/validation/virtualmachineservice_validator_unit_test.go similarity index 98% rename from webhooks/virtualmachineservice/v1alpha2/validation/virtualmachineservice_validator_unit_test.go rename to webhooks/virtualmachineservice/validation/virtualmachineservice_validator_unit_test.go index 1f040b4d9..8a0d9a6f0 100644 --- a/webhooks/virtualmachineservice/v1alpha2/validation/virtualmachineservice_validator_unit_test.go +++ b/webhooks/virtualmachineservice/validation/virtualmachineservice_validator_unit_test.go @@ -11,7 +11,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -21,7 +21,7 @@ func unitTests() { "Create", Label( testlabels.Create, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -31,7 +31,7 @@ func unitTests() { "Update", Label( testlabels.Update, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -41,7 +41,7 @@ func unitTests() { "Delete", Label( testlabels.Delete, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -227,7 +227,7 @@ func unitTestsValidateCreate() { }, }, ), - Entry("should deny duplicate protocol/port", "spec.ports[1]: Duplicate value: v1alpha2.VirtualMachineServicePort", + Entry("should deny duplicate protocol/port", "spec.ports[1]: Duplicate value: v1alpha3.VirtualMachineServicePort", []vmopv1.VirtualMachineServicePort{ { Name: "port1", diff --git a/webhooks/virtualmachineservice/webhooks.go b/webhooks/virtualmachineservice/webhooks.go index 885c176a5..b5e73fa35 100644 --- a/webhooks/virtualmachineservice/webhooks.go +++ b/webhooks/virtualmachineservice/webhooks.go @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2023-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package virtualmachineservice @@ -7,9 +7,13 @@ import ( ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/v1alpha2" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/mutation" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/validation" ) func AddToManager(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager) error { - return v1alpha2.AddToManager(ctx, mgr) + if err := mutation.AddToManager(ctx, mgr); err != nil { + return err + } + return validation.AddToManager(ctx, mgr) } diff --git a/webhooks/virtualmachinesetresourcepolicy/v1alpha2/webhooks.go b/webhooks/virtualmachinesetresourcepolicy/v1alpha2/webhooks.go deleted file mode 100644 index 1c3e76a29..000000000 --- a/webhooks/virtualmachinesetresourcepolicy/v1alpha2/webhooks.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2019 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package v1alpha2 - -import ( - "github.com/pkg/errors" - - ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation" -) - -func AddToManager(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager) error { - if err := validation.AddToManager(ctx, mgr); err != nil { - return errors.Wrap(err, "failed to initialize validation webhook") - } - return nil -} diff --git a/webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation/virtualmachinesetresourcepolicy_validator.go b/webhooks/virtualmachinesetresourcepolicy/validation/virtualmachinesetresourcepolicy_validator.go similarity index 96% rename from webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation/virtualmachinesetresourcepolicy_validator.go rename to webhooks/virtualmachinesetresourcepolicy/validation/virtualmachinesetresourcepolicy_validator.go index 0c6ff6453..3e100fa54 100644 --- a/webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation/virtualmachinesetresourcepolicy_validator.go +++ b/webhooks/virtualmachinesetresourcepolicy/validation/virtualmachinesetresourcepolicy_validator.go @@ -20,7 +20,7 @@ import ( "github.com/pkg/errors" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/builder" "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -31,7 +31,7 @@ const ( webHookName = "default" ) -// +kubebuilder:webhook:verbs=create;update,path=/default-validate-vmoperator-vmware-com-v1alpha2-virtualmachinesetresourcepolicy,mutating=false,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachinesetresourcepolicies,versions=v1alpha2,name=default.validating.virtualmachinesetresourcepolicy.v1alpha2.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/default-validate-vmoperator-vmware-com-v1alpha3-virtualmachinesetresourcepolicy,mutating=false,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachinesetresourcepolicies,versions=v1alpha3,name=default.validating.virtualmachinesetresourcepolicy.v1alpha3.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachinesetresourcepolicies,verbs=get;list // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachinesetresourcepolicies/status,verbs=get diff --git a/webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation/virtualmachinesetresourcepolicy_validator_intg_test.go b/webhooks/virtualmachinesetresourcepolicy/validation/virtualmachinesetresourcepolicy_validator_intg_test.go similarity index 96% rename from webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation/virtualmachinesetresourcepolicy_validator_intg_test.go rename to webhooks/virtualmachinesetresourcepolicy/validation/virtualmachinesetresourcepolicy_validator_intg_test.go index 514eae244..572a8e49e 100644 --- a/webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation/virtualmachinesetresourcepolicy_validator_intg_test.go +++ b/webhooks/virtualmachinesetresourcepolicy/validation/virtualmachinesetresourcepolicy_validator_intg_test.go @@ -10,7 +10,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -22,7 +22,7 @@ func intgTests() { Label( testlabels.Create, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -33,7 +33,7 @@ func intgTests() { Label( testlabels.Update, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -44,7 +44,7 @@ func intgTests() { Label( testlabels.Delete, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), diff --git a/webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation/virtualmachinesetresourcepolicy_validator_suite_test.go b/webhooks/virtualmachinesetresourcepolicy/validation/virtualmachinesetresourcepolicy_validator_suite_test.go similarity index 88% rename from webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation/virtualmachinesetresourcepolicy_validator_suite_test.go rename to webhooks/virtualmachinesetresourcepolicy/validation/virtualmachinesetresourcepolicy_validator_suite_test.go index 04cc37baa..7ab3a5bc8 100644 --- a/webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation/virtualmachinesetresourcepolicy_validator_suite_test.go +++ b/webhooks/virtualmachinesetresourcepolicy/validation/virtualmachinesetresourcepolicy_validator_suite_test.go @@ -10,7 +10,7 @@ import ( pkgconfig "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/test/builder" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesetresourcepolicy/validation" ) // suite is used for unit and integration testing this webhook. @@ -18,7 +18,7 @@ var suite = builder.NewTestSuiteForValidatingWebhookWithContext( pkgconfig.NewContext(), validation.AddToManager, validation.NewValidator, - "default.validating.virtualmachinesetresourcepolicy.v1alpha2.vmoperator.vmware.com") + "default.validating.virtualmachinesetresourcepolicy.v1alpha3.vmoperator.vmware.com") func TestWebhook(t *testing.T) { suite.Register(t, "Validation webhook suite", intgTests, unitTests) diff --git a/webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation/virtualmachinesetresourcepolicy_validator_unit_test.go b/webhooks/virtualmachinesetresourcepolicy/validation/virtualmachinesetresourcepolicy_validator_unit_test.go similarity index 98% rename from webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation/virtualmachinesetresourcepolicy_validator_unit_test.go rename to webhooks/virtualmachinesetresourcepolicy/validation/virtualmachinesetresourcepolicy_validator_unit_test.go index 7b099bb47..e4dd111bf 100644 --- a/webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation/virtualmachinesetresourcepolicy_validator_unit_test.go +++ b/webhooks/virtualmachinesetresourcepolicy/validation/virtualmachinesetresourcepolicy_validator_unit_test.go @@ -13,7 +13,7 @@ import ( "k8s.io/apimachinery/pkg/util/validation/field" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -23,7 +23,7 @@ func unitTests() { "Create", Label( testlabels.Create, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -33,7 +33,7 @@ func unitTests() { "Update", Label( testlabels.Update, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -43,7 +43,7 @@ func unitTests() { "Delete", Label( testlabels.Delete, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), diff --git a/webhooks/virtualmachinesetresourcepolicy/webhooks.go b/webhooks/virtualmachinesetresourcepolicy/webhooks.go index 45ab29f9f..981ed6601 100644 --- a/webhooks/virtualmachinesetresourcepolicy/webhooks.go +++ b/webhooks/virtualmachinesetresourcepolicy/webhooks.go @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. All Rights Reserved. +// Copyright (c) 2023-2024 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package virtualmachinesetresourcepolicy @@ -7,9 +7,9 @@ import ( ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" "github.com/vmware-tanzu/vm-operator/pkg/context" - "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesetresourcepolicy/v1alpha2" + "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesetresourcepolicy/validation" ) func AddToManager(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager) error { - return v1alpha2.AddToManager(ctx, mgr) + return validation.AddToManager(ctx, mgr) } diff --git a/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation/webconsolerequest_validator.go b/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation/webconsolerequest_validator.go index 636951171..fdc25640b 100644 --- a/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation/webconsolerequest_validator.go +++ b/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation/webconsolerequest_validator.go @@ -19,7 +19,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/webhook" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" webconsolerequest "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1" "github.com/vmware-tanzu/vm-operator/pkg/builder" "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -56,7 +56,7 @@ type validator struct { } func (v validator) For() schema.GroupVersionKind { - return vmopv1.SchemeGroupVersion.WithKind(reflect.TypeOf(vmopv1.WebConsoleRequest{}).Name()) + return vmopv1a1.SchemeGroupVersion.WithKind(reflect.TypeOf(vmopv1a1.WebConsoleRequest{}).Name()) } func (v validator) ValidateCreate(ctx *context.WebhookRequestContext) admission.Response { @@ -104,12 +104,12 @@ func (v validator) ValidateUpdate(ctx *context.WebhookRequestContext) admission. return common.BuildValidationResponse(ctx, nil, validationErrs, nil) } -func (v validator) validateMetadata(ctx *context.WebhookRequestContext, wcr *vmopv1.WebConsoleRequest) field.ErrorList { +func (v validator) validateMetadata(ctx *context.WebhookRequestContext, wcr *vmopv1a1.WebConsoleRequest) field.ErrorList { var fieldErrs field.ErrorList return fieldErrs } -func (v validator) validateSpec(ctx *context.WebhookRequestContext, wcr *vmopv1.WebConsoleRequest) field.ErrorList { +func (v validator) validateSpec(ctx *context.WebhookRequestContext, wcr *vmopv1a1.WebConsoleRequest) field.ErrorList { var fieldErrs field.ErrorList specPath := field.NewPath("spec") @@ -119,7 +119,7 @@ func (v validator) validateSpec(ctx *context.WebhookRequestContext, wcr *vmopv1. return fieldErrs } -func (v validator) validateVirtualMachineName(path *field.Path, wcr *vmopv1.WebConsoleRequest) field.ErrorList { +func (v validator) validateVirtualMachineName(path *field.Path, wcr *vmopv1a1.WebConsoleRequest) field.ErrorList { var allErrs field.ErrorList if wcr.Spec.VirtualMachineName == "" { @@ -154,7 +154,7 @@ func (v validator) validatePublicKey(path *field.Path, publicKey string) field.E return allErrs } -func (v validator) validateImmutableFields(wcr, oldwcr *vmopv1.WebConsoleRequest) field.ErrorList { +func (v validator) validateImmutableFields(wcr, oldwcr *vmopv1a1.WebConsoleRequest) field.ErrorList { var allErrs field.ErrorList specPath := field.NewPath("spec") @@ -165,15 +165,15 @@ func (v validator) validateImmutableFields(wcr, oldwcr *vmopv1.WebConsoleRequest } // webConsoleRequestFromUnstructured returns the wcr from the unstructured object. -func (v validator) webConsoleRequestFromUnstructured(obj runtime.Unstructured) (*vmopv1.WebConsoleRequest, error) { - wcr := &vmopv1.WebConsoleRequest{} +func (v validator) webConsoleRequestFromUnstructured(obj runtime.Unstructured) (*vmopv1a1.WebConsoleRequest, error) { + wcr := &vmopv1a1.WebConsoleRequest{} if err := v.converter.FromUnstructured(obj.UnstructuredContent(), wcr); err != nil { return nil, err } return wcr, nil } -func (v validator) validateUUIDLabel(wcr, oldwcr *vmopv1.WebConsoleRequest) field.ErrorList { +func (v validator) validateUUIDLabel(wcr, oldwcr *vmopv1a1.WebConsoleRequest) field.ErrorList { var allErrs field.ErrorList oldUUIDLabelVal := oldwcr.Labels[webconsolerequest.UUIDLabelKey] diff --git a/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation/webconsolerequest_validator_intg_test.go b/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation/webconsolerequest_validator_intg_test.go index 9a060891e..a61082bce 100644 --- a/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation/webconsolerequest_validator_intg_test.go +++ b/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation/webconsolerequest_validator_intg_test.go @@ -9,7 +9,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -52,7 +52,7 @@ func intgTests() { type intgValidatingWebhookContext struct { builder.IntegrationTestContext - wcr *vmopv1.WebConsoleRequest + wcr *vmopv1a1.WebConsoleRequest privateKey *rsa.PrivateKey } diff --git a/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation/webconsolerequest_validator_unit_test.go b/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation/webconsolerequest_validator_unit_test.go index b0bfe138c..b93481ca8 100644 --- a/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation/webconsolerequest_validator_unit_test.go +++ b/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation/webconsolerequest_validator_unit_test.go @@ -13,7 +13,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -57,8 +57,8 @@ func unitTests() { type unitValidatingWebhookContext struct { builder.UnitTestContextForValidatingWebhook - wcr *vmopv1.WebConsoleRequest - oldWcr *vmopv1.WebConsoleRequest + wcr *vmopv1a1.WebConsoleRequest + oldWcr *vmopv1a1.WebConsoleRequest privateKey *rsa.PrivateKey } @@ -72,7 +72,7 @@ func newUnitTestContextForValidatingWebhook(isUpdate bool) *unitValidatingWebhoo obj, err := builder.ToUnstructured(wcr) Expect(err).ToNot(HaveOccurred()) - var oldWcr *vmopv1.WebConsoleRequest + var oldWcr *vmopv1a1.WebConsoleRequest var oldObj *unstructured.Unstructured if isUpdate { diff --git a/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator.go b/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator.go index 67b75c92f..3fdb74519 100644 --- a/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator.go +++ b/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator.go @@ -19,7 +19,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/webhook" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" webconsolerequest "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha2" "github.com/vmware-tanzu/vm-operator/pkg/builder" "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -30,7 +30,7 @@ const ( webHookName = "default" ) -// +kubebuilder:webhook:verbs=create;update,path=/default-validate-vmoperator-vmware-com-v1alpha2-virtualmachinewebconsolerequest,mutating=false,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachinewebconsolerequests,versions=v1alpha2,name=default.validating.virtualmachinewebconsolerequest.v1alpha2.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/default-validate-vmoperator-vmware-com-v1alpha3-virtualmachinewebconsolerequest,mutating=false,failurePolicy=fail,groups=vmoperator.vmware.com,resources=virtualmachinewebconsolerequests,versions=v1alpha3,name=default.validating.virtualmachinewebconsolerequest.v1alpha3.vmoperator.vmware.com,sideEffects=None,admissionReviewVersions=v1;v1beta1 // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachinewebconsolerequests,verbs=get;list // +kubebuilder:rbac:groups=vmoperator.vmware.com,resources=virtualmachinewebconsolerequests/status,verbs=get diff --git a/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator_intg_test.go b/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator_intg_test.go index aa0f33e48..aeaaef085 100644 --- a/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator_intg_test.go +++ b/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator_intg_test.go @@ -9,7 +9,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" ) @@ -20,7 +20,7 @@ func intgTests() { Label( testlabels.Create, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -31,7 +31,7 @@ func intgTests() { Label( testlabels.Update, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -42,7 +42,7 @@ func intgTests() { Label( testlabels.Delete, testlabels.EnvTest, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), diff --git a/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator_suite_test.go b/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator_suite_test.go index c29fcac5a..aba62d70b 100644 --- a/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator_suite_test.go +++ b/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator_suite_test.go @@ -18,7 +18,7 @@ var suite = builder.NewTestSuiteForValidatingWebhookWithContext( pkgconfig.NewContext(), validation.AddToManager, validation.NewValidator, - "default.validating.virtualmachinewebconsolerequest.v1alpha2.vmoperator.vmware.com") + "default.validating.virtualmachinewebconsolerequest.v1alpha3.vmoperator.vmware.com") func TestWebhook(t *testing.T) { suite.Register(t, "Validation webhook suite", intgTests, unitTests) diff --git a/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator_unit_test.go b/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator_unit_test.go index 8d703879b..23cff5d63 100644 --- a/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator_unit_test.go +++ b/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation/webconsolerequest_validator_unit_test.go @@ -13,7 +13,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha2" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" "github.com/vmware-tanzu/vm-operator/test/builder" @@ -24,7 +24,7 @@ func unitTests() { "Create", Label( testlabels.Create, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -34,7 +34,7 @@ func unitTests() { "Update", Label( testlabels.Update, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ), @@ -44,7 +44,7 @@ func unitTests() { "Delete", Label( testlabels.Delete, - testlabels.V1Alpha2, + testlabels.V1Alpha3, testlabels.Validation, testlabels.Webhook, ),