Skip to content

Conversation

hardcoretime
Copy link
Contributor

@hardcoretime hardcoretime commented Jan 20, 2025

Description

Add events when VirtualMachineSnapshot:

  • waits for dependent resources;
  • is started;
  • is failed;
  • is completed.

Why do we need it, and what problem does it solve?

It improves user experience in the snapshotting process of VirtualMachine.

What is the expected result?

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

@hardcoretime hardcoretime force-pushed the feat/vmsnapshot/add-new-events branch from bee9d48 to 2618d97 Compare January 20, 2025 18:54
@hardcoretime hardcoretime requested a review from Isteb4k January 20, 2025 19:18
@hardcoretime hardcoretime marked this pull request as ready for review January 20, 2025 19:37
Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
@hardcoretime hardcoretime force-pushed the feat/vmsnapshot/add-new-events branch from 2618d97 to a664fe1 Compare January 22, 2025 08:29
vm, err := h.snapshotter.GetVirtualMachine(ctx, vmSnapshot.Spec.VirtualMachineName, vmSnapshot.Namespace)
if err != nil {
setPhaseConditionToFailed(cb, &vmSnapshot.Status.Phase, err)
setPhaseConditionToFailed(h, cb, vmSnapshot, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make the function a method? So we don't have to pass the handler as an argument.

vmSnapshot,
corev1.EventTypeWarning,
virtv2.ReasonVMSnapshottingFailed,
err.Error()+".",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

service.CapitalizeFirstLetter(err.Error()) + "."
The same as for the message below.

Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
@hardcoretime hardcoretime force-pushed the feat/vmsnapshot/add-new-events branch from d1278fe to 2ab1419 Compare January 22, 2025 14:19
Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
@hardcoretime hardcoretime force-pushed the feat/vmsnapshot/add-new-events branch from 2ab1419 to a6299d4 Compare January 22, 2025 14:36
@hardcoretime hardcoretime merged commit ab9fe54 into main Jan 22, 2025
12 checks passed
@hardcoretime hardcoretime deleted the feat/vmsnapshot/add-new-events branch January 22, 2025 15:11
hardcoretime added a commit that referenced this pull request Jan 23, 2025
Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants