Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubevirt: Tag external-boot-image with eve-release #3921

Merged
Merged
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -798,8 +798,8 @@ pkg/external-boot-image/build.yml: pkg/external-boot-image/build.yml.in
pkg/external-boot-image: pkg/external-boot-image/build.yml
pkg/kube: pkg/external-boot-image
$(MAKE) eve-external-boot-image
$(MAKE) cache-export IMAGE=$(shell $(LINUXKIT) pkg show-tag pkg/external-boot-image) OUTFILE=pkg/kube/external-boot-image.tar && \
$(MAKE) eve-kube && rm -f pkg/kube/external-boot-image.tar && rm -f pkg/external-boot-image/build.yml
$(MAKE) cache-export IMAGE=$(shell $(LINUXKIT) pkg show-tag pkg/external-boot-image | tee pkg/kube/external-boot-image.tag) OUTFILE=pkg/kube/external-boot-image.tar && \
$(MAKE) eve-kube && rm -f pkg/kube/external-boot-image.tar pkg/kube/external-boot-image.tag pkg/external-boot-image/build.yml
$(QUIET): $@: Succeeded
pkg/pillar: pkg/dnsmasq pkg/gpt-tools pkg/dom0-ztools eve-pillar
$(QUIET): $@: Succeeded
Expand Down
1 change: 1 addition & 0 deletions pkg/kube/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ COPY multus-daemonset.yaml /etc
COPY kubevirt-operator.yaml /etc
COPY kubevirt-features.yaml /etc
COPY external-boot-image.tar /etc/
COPY external-boot-image.tag /etc/

# Longhorn config
COPY iscsid.conf /etc/iscsi/
Expand Down
7 changes: 6 additions & 1 deletion pkg/kube/cluster-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,12 @@ check_start_containerd() {
# This is very similar to what we do on kvm based eve to start container as a VM.
logmsg "Trying to install new external-boot-image"
# This import happens once per reboot
if ctr -a /run/containerd-user/containerd.sock image import /etc/external-boot-image.tar docker.io/lfedge/eve-external-boot-image:latest; then
if ctr -a /run/containerd-user/containerd.sock image import /etc/external-boot-image.tar; then
eve_external_boot_img_tag=$(cat /run/eve-release)
eve_external_boot_img=docker.io/lfedge/eve-external-boot-image:"$eve_external_boot_img_tag"
import_tag=$(cat /etc/external-boot-image.tag)
ctr -a /run/containerd-user/containerd.sock image tag "docker.io/${import_tag}" "$eve_external_boot_img"

logmsg "Successfully installed external-boot-image"
rm -f /etc/external-boot-image.tar
fi
Expand Down
6 changes: 5 additions & 1 deletion pkg/pillar/hypervisor/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,11 @@ func (ctx kubevirtContext) CreateVMIConfig(domainName string, config types.Domai
// https://kubevirt.io/user-guide/virtual_machines/boot_from_external_source/
// Since disks are virtio disks we assume /dev/vda is the boot disk
kernelArgs := "console=tty0 root=/dev/vda dhcp=1 rootfstype=ext4"
scratchImage := "docker.io/lfedge/eve-external-boot-image:latest"
eveRelease, err := os.ReadFile("/run/eve-release")
if err != nil {
return logError("Failed to fetch eve-release %v", err)
}
scratchImage := "docker.io/lfedge/eve-external-boot-image:" + string(eveRelease)
kernelPath := "/kernel"
initrdPath := "/runx-initrd"

Expand Down
Loading