Skip to content

Commit 8f047d8

Browse files
author
Yi Jiang
committed
Followup changes for VirtualMachinePublishRequest conditions.
This change includes: - Mimic actual workflow in VirtualMahincePublishRequest integration test. - Fix race in VirtualMachinePublishRequest validation webhook integration tests. - Update VirtualMachinePublishRequest true condition. No reason for True condition to keep consistent with other VM Operator resources and upstream resources. - Update requeue delay when source and target location does not exist, and VM publish request does not start. - Handle the case when a prior task related to the vmPub succeeded, but for some reason we failed to get the task status. Use a VM operator specific description to link content library item and the VirtualMachinePublishRequest object. - Add target item name check in validation webhook to prevent specifying an existing item name - Remove duplicate logic in webhook. Test done: - Passed gce2e internally. - Manually deployed this patch, VM can be published successfully.
1 parent c4b0bf4 commit 8f047d8

19 files changed

+853
-658
lines changed

api/v1alpha1/condition_consts.go

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -125,53 +125,3 @@ const (
125125
// is not in ready state.
126126
VirtualMachineImageProviderNotReadyReason = "VirtualMachineImageProviderNotReady"
127127
)
128-
129-
// Condition.Reason for Conditions related to VirtualMachinePublishRequest.
130-
const (
131-
// SourceVirtualMachineNotExistReason documents that the source VM of
132-
// the VirtualMachinePublishRequest doesn't exist.
133-
SourceVirtualMachineNotExistReason = "SourceVirtualMachineNotExist"
134-
135-
// SourceVirtualMachineNotCreatedReason documents that the source VM of
136-
// the VirtualMachinePublishRequest hasn't been created.
137-
SourceVirtualMachineNotCreatedReason = "SourceVirtualMachineNotCreated"
138-
139-
// TargetContentLibraryNotExistReason documents that the target content
140-
// library of the VirtualMachinePublishRequest doesn't exist.
141-
TargetContentLibraryNotExistReason = "TargetContentLibraryNotExist"
142-
143-
// TargetContentLibraryNotWritableReason documents that the target content
144-
// library of the VirtualMachinePublishRequest isn't writable.
145-
TargetContentLibraryNotWritableReason = "TargetContentLibraryNotWritable"
146-
147-
// TargetItemAlreadyExistsReason documents that in the target content
148-
// library, there is already an item, which has the same name with the
149-
// VirtualMachinePublishRequest's target item.
150-
TargetItemAlreadyExistsReason = "TargetItemAlreadyExists"
151-
152-
// TargetVirtualMachineImageNotFoundReason documents that the expected
153-
// VirtualMachineImage resource which is corresponding to VirtualMachinePublishRequest
154-
// target item is not found in the cluster.
155-
TargetVirtualMachineImageNotFoundReason = "VirtualMachineImageNotFound"
156-
157-
// UploadTaskQueuedReason documents that the VM publish task is in queued status.
158-
UploadTaskQueuedReason = "Queued"
159-
160-
// UploadingReason documents that the VM publish task is in running status
161-
// and the published item is uploading to the target location.
162-
UploadingReason = "Uploading"
163-
164-
// UploadFailureReason documents that uploading published item to the
165-
// target location failed.
166-
UploadFailureReason = "UploadFailure"
167-
168-
// HasNotBeenUploadedReason documents that the VirtualMachinePublishRequest
169-
// hasn't completed because the published item hasn't been uploaded
170-
// to the target location.
171-
HasNotBeenUploadedReason = "HasNotBeenUploaded"
172-
173-
// ImageUnavailableReason documents that the VirtualMachinePublishRequest
174-
// hasn't been completed because the expected VirtualMachineImage resource
175-
// hasn't been available yet.
176-
ImageUnavailableReason = "ImageUnavailable"
177-
)

0 commit comments

Comments
 (0)