Skip to content
Merged
2 changes: 1 addition & 1 deletion api/core/v1alpha2/virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const (
// +kubebuilder:subresource:status
// +kubebuilder:resource:categories={all,virtualization},scope=Namespaced,shortName={vm},singular=virtualmachine
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="The phase of the virtual machine."
// +kubebuilder:printcolumn:name="PhaseAge",type="date",JSONPath=".status.stats.phasesTransitions[-1].timestamp",description="Time since the virtual machine entered the current phase."
// +kubebuilder:printcolumn:name="Uptime",type="date",JSONPath=".status.conditions[?(@.reason==\"Running\")].lastTransitionTime",description="Time since the virtual machine started running."
// +kubebuilder:printcolumn:name="Cores",priority=1,type="string",JSONPath=".spec.cpu.cores",description="The number of cores of the virtual machine."
// +kubebuilder:printcolumn:name="CoreFraction",priority=1,type="string",JSONPath=".spec.cpu.coreFraction",description="Virtual machine core fraction. The range of available values is set in the `sizePolicy` parameter of the VirtualMachineClass; if it is not set, use values within the 1–100% range."
// +kubebuilder:printcolumn:name="Memory",priority=1,type="string",JSONPath=".spec.memory.size",description="The amount of memory of the virtual machine."
Expand Down
4 changes: 3 additions & 1 deletion crds/doc-ru-virtualmachines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,9 @@ spec:
`.metadata.generation`, на основе которого было установлено условие.
Например, если `.metadata.generation` в настоящее время имеет значение `12`, а `.status.conditions[x].observedgeneration` имеет значение `9`, то условие устарело.
reason:
description: Краткая причина последнего перехода состояния.
description: |
Краткая причина последнего перехода состояния.
Значение `Running` используется для отображения времени работы ВМ в колонке `Uptime`.
status:
description: |
Статус условия. Возможные значения: `True`, `False`, `Unknown`.
Expand Down
6 changes: 3 additions & 3 deletions crds/virtualmachines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1422,9 +1422,9 @@ spec:
jsonPath: .status.phase
name: Phase
type: string
- description: Time since the virtual machine entered the current phase.
jsonPath: .status.stats.phasesTransitions[-1].timestamp
name: PhaseAge
- description: Time since the virtual machine started running.
jsonPath: '.status.conditions[?(@.reason=="Running")].lastTransitionTime'
name: Uptime
type: date
- description: Real number of the virtual machine cores.
jsonPath: .status.resources.cpu.cores
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,12 @@ func (h *LifeCycleHandler) syncRunning(ctx context.Context, vm *v1alpha2.Virtual
}
for _, c := range kvvmi.Status.Conditions {
if c.Type == virtv1.VirtualMachineInstanceReady {
reason := getKVMIReadyReason(c.Reason)
if c.Status == corev1.ConditionTrue && c.Reason == "" {
reason = vmcondition.ReasonVirtualMachineRunning
}
cb.Status(conditionStatus(string(c.Status))).
Reason(getKVMIReadyReason(c.Reason)).
Reason(reason).
Message(c.Message)
conditions.SetCondition(cb, &vm.Status.Conditions)
return nil
Expand Down
Loading