Skip to content

Commit

Permalink
refactor(vmop): change vm label from name to uid (#460)
Browse files Browse the repository at this point in the history
- VM name may exceed 63 characters limit on the label value
- UID is more robust for the purpose to get all related VMOPs.
- UID is already set for VMIP resources.

Signed-off-by: Ivan Mikheykin <[email protected]>
  • Loading branch information
diafour authored Oct 21, 2024
1 parent 4e7e50a commit 248b2ae
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (h LifecycleHandler) Handle(ctx context.Context, s state.VMOperationState)

// Initialize new VMOP resource: set label with vm name, set phase to Pending and all conditions to Unknown.
if changed.Status.Phase == "" {
cc.AddLabel(changed, cc.LabelVirtualMachineName, changed.Spec.VirtualMachine)
cc.AddLabel(changed, cc.LabelVirtualMachineUID, string(changed.GetUID()))
changed.Status.Phase = virtv2.VMOPPhasePending
// Add all conditions in unknown state.
conditions.SetCondition(
Expand Down

0 comments on commit 248b2ae

Please sign in to comment.