Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Daniil Antoshin <[email protected]>
  • Loading branch information
danilrwx committed Dec 25, 2024
1 parent 410f925 commit 329c70a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
2 changes: 0 additions & 2 deletions api/core/v1alpha2/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ const (
// ReasonVMClassInUse is event reason that VMClass is used by virtual machine.
ReasonVMClassInUse = "VirtualMachineClassInUse"

// ReasonVDStorageClassWasDeleted is event reason that VDStorageClass was deleted.
ReasonVDStorageClassWasDeleted = "VirtualDiskStorageClassWasDeleted"
// ReasonVDStorageClassNotFound is event reason that VDStorageClass not found.
ReasonVDStorageClassNotFound = "VirtualDiskStorageClassNotFound"
// ReasonVDSpecChanged is event reason that VDStorageClass is chanded.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ func (ds ObjectRefDataSource) Sync(ctx context.Context, cvi *virtv2.ClusterVirtu

log.Info("Cleaning up...")
case pod == nil:
ds.recorder.Event(
cvi,
corev1.EventTypeNormal,
virtv2.ReasonDataSourceSyncStarted,
"The ObjectRef DataSource import has started",
)
var dvcrDataSource controller.DVCRDataSource
dvcrDataSource, err = controller.NewDVCRDataSourcesForCVMI(ctx, cvi.Spec.DataSource, ds.client)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ func (ds ObjectRefVirtualDisk) Sync(ctx context.Context, cvi *virtv2.ClusterVirt

log.Info("Cleaning up...")
case pod == nil:
ds.recorder.Event(
cvi,
corev1.EventTypeNormal,
virtv2.ReasonDataSourceSyncStarted,
"The ObjectRef DataSource import has started",
)
cvi.Status.Progress = ds.statService.GetProgress(cvi.GetUID(), pod, cvi.Status.Progress)
cvi.Status.Target.RegistryURL = ds.statService.GetDVCRImageName(pod)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ func (ds ObjectRefVirtualImageOnPvc) Sync(ctx context.Context, cvi *virtv2.Clust

log.Info("Cleaning up...")
case pod == nil:
ds.recorder.Event(
cvi,
corev1.EventTypeNormal,
virtv2.ReasonDataSourceSyncStarted,
"The ObjectRef DataSource import has started",
)
cvi.Status.Progress = ds.statService.GetProgress(cvi.GetUID(), pod, cvi.Status.Progress)
cvi.Status.Target.RegistryURL = ds.statService.GetDVCRImageName(pod)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ func (ds RegistryDataSource) Sync(ctx context.Context, cvi *virtv2.ClusterVirtua

log.Info("Cleaning up...")
case pod == nil:
ds.recorder.Event(
cvi,
corev1.EventTypeNormal,
virtv2.ReasonDataSourceSyncStarted,
"The Registry DataSource import has started",
)
cvi.Status.Progress = "0%"

envSettings := ds.getEnvSettings(cvi, supgen)
Expand Down Expand Up @@ -157,7 +163,7 @@ func (ds RegistryDataSource) Sync(ctx context.Context, cvi *virtv2.ClusterVirtua
cvi,
corev1.EventTypeNormal,
virtv2.ReasonDataSourceSyncCompleted,
"The HTTP DataSource import has completed",
"The Registry DataSource import has completed",
)

cb.
Expand Down

0 comments on commit 329c70a

Please sign in to comment.