Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .werf/defines/images.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ Result:
{{- end }}
{{- end -}}
{{- end }}
{{ end }}
{{ end }}
4 changes: 2 additions & 2 deletions build/components/versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ firmware:
libvirt: v10.9.0
edk2: stable202411
core:
3p-kubevirt: v1.3.1-v12n.11
3p-containerized-data-importer: v1.60.3-v12n.9
3p-kubevirt: v1.3.1-v12n.12
3p-containerized-data-importer: v1.60.3-v12n.10
distribution: 2.8.3
package:
acl: v2.3.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/deckhouse/deckhouse/pkg/log"
"github.com/deckhouse/virtualization-controller/pkg/audit/events"
"github.com/deckhouse/virtualization-controller/pkg/audit/util"
vmutil "github.com/deckhouse/virtualization-controller/pkg/common/vm"
)

func NewVMControl(options events.EventLoggerOptions) *VMControl {
Expand Down Expand Up @@ -73,7 +74,7 @@ func (m *VMControl) Fill() error {

var terminatedStatuses string
for _, status := range pod.Status.ContainerStatuses {
if status.Name == "compute" && status.State.Terminated != nil {
if vmutil.IsComputeContainer(status.Name) && status.State.Terminated != nil {
terminatedStatuses = status.State.Terminated.Message
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var _ = Describe("VMOP Events", func() {
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: "compute",
Name: "d8v-compute",
Image: "test-image",
},
},
Expand All @@ -95,7 +95,7 @@ var _ = Describe("VMOP Events", func() {
Status: corev1.PodStatus{
ContainerStatuses: []corev1.ContainerStatus{
{
Name: "compute",
Name: "d8v-compute",
State: corev1.ContainerState{Terminated: &corev1.ContainerStateTerminated{Message: "guest-shutdown"}},
},
},
Expand Down
6 changes: 3 additions & 3 deletions images/virtualization-artifact/pkg/common/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ const (
OwnerUID = "OWNER_UID"

// BounderContainerName provides a constant to use as a name for bounder Container
BounderContainerName = "bounder"
BounderContainerName = "d8v-dvcr-bounder"
// ImporterContainerName provides a constant to use as a name for importer Container
ImporterContainerName = "importer"
ImporterContainerName = "d8v-dvcr-importer"
// UploaderContainerName provides a constant to use as a name for uploader Container
UploaderContainerName = "uploader"
UploaderContainerName = "d8v-dvcr-uploader"
// UploaderPortName provides a constant to use as a port name for uploader Service
UploaderPortName = "uploader"
// UploaderPort provides a constant to use as a port for uploader Service
Expand Down
10 changes: 10 additions & 0 deletions images/virtualization-artifact/pkg/common/vm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ limitations under the License.
package vm

import (
"strings"

virtv2 "github.com/deckhouse/virtualization/api/core/v1alpha2"
)

// VMContainerNameSuffix - a name suffix for container with virt-launcher, libvirt and qemu processes.
// Container name is "d8v-compute", but previous versions may have "compute" container.
const VMContainerNameSuffix = "compute"

// CalculateCoresAndSockets calculates the number of sockets and cores per socket needed to achieve
// the desired total number of CPU cores.
// The function tries to minimize the number of sockets while ensuring the desired core count.
Expand Down Expand Up @@ -59,3 +65,7 @@ func ApprovalMode(vm *virtv2.VirtualMachine) virtv2.RestartApprovalMode {
}
return vm.Spec.Disruptions.RestartApprovalMode
}

func IsComputeContainer(name string) bool {
return strings.HasSuffix(name, VMContainerNameSuffix)
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ import (

corev1 "k8s.io/api/core/v1"
kvv1 "kubevirt.io/api/core/v1"

vmutil "github.com/deckhouse/virtualization-controller/pkg/common/vm"
)

type GuestSignalReason string

const (
// DefaultVMContainerName - a container name with virt-launcher, libvirt and qemu processes.
DefaultVMContainerName = "compute"

// GuestResetReason - a reboot command was issued from inside the VM.
GuestResetReason GuestSignalReason = "guest-reset"

Expand Down Expand Up @@ -65,10 +64,9 @@ func ShutdownReason(kvvmi *kvv1.VirtualMachineInstance, kvPods *corev1.PodList)
return ShutdownInfo{}
}

// Extract termination mesage from the "compute" container.
// Extract termination message from the container with VM.
for _, contStatus := range recentPod.Status.ContainerStatuses {
// "compute" is a default container name for VM Pod.
if contStatus.Name != DefaultVMContainerName {
if !vmutil.IsComputeContainer(contStatus.Name) {
continue
}
msg := ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (h *StatisticHandler) syncResources(changed *virtv2.VirtualMachine,
}
var ctr corev1.Container
for _, container := range pod.Spec.Containers {
if container.Name == "compute" {
if vm.IsComputeContainer(container.Name) {
ctr = container
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var _ = Describe("TestStatisticHandler", func() {
NodeName: nodeName,
Containers: []corev1.Container{
{
Name: "compute",
Name: "d8v-compute",
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse(requestCPU),
Expand Down
Loading