Skip to content

Commit

Permalink
Kubevirt: don't delete external-boot-image.tar
Browse files Browse the repository at this point in the history
Deletion of this leads to unreliability of
pkg/kube build where build-time tag and post-build tag didn't match.
The result was installer-raw or live targets failed to find
pkg/kube in the cache.
Refactored pkg/kube, pkg/external-boot-image target deps to
see the issue clearer.

Signed-off-by: Andrew Durbin <andrewd@zededa.com>
  • Loading branch information
andrewd-zededa authored and eriknordmark committed May 23, 2024
1 parent 0060b5b commit 7cd8640
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -795,11 +795,10 @@ pkgs: build-tools $(PKGS)

pkg/external-boot-image/build.yml: pkg/external-boot-image/build.yml.in
$(QUIET)tools/compose-external-boot-image-yml.sh $< $@ $(shell echo ${KERNEL_TAG} | cut -d':' -f2) $(shell $(LINUXKIT) pkg show-tag pkg/xen-tools | cut -d':' -f2)
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 | 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
eve-external-boot-image: pkg/external-boot-image/build.yml
pkg/kube/external-boot-image.tar: pkg/external-boot-image
$(MAKE) cache-export IMAGE=$(shell $(LINUXKIT) pkg show-tag pkg/external-boot-image) OUTFILE=pkg/kube/external-boot-image.tar
pkg/kube: pkg/kube/external-boot-image.tar eve-kube
$(QUIET): $@: Succeeded
pkg/pillar: pkg/dnsmasq pkg/gpt-tools pkg/dom0-ztools eve-pillar
$(QUIET): $@: Succeeded
Expand Down
1 change: 0 additions & 1 deletion pkg/kube/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ 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
6 changes: 3 additions & 3 deletions pkg/kube/cluster-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,10 @@ check_start_containerd() {
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"
import_tag=$(tar -xOf /etc/external-boot-image.tar manifest.json | jq -r '.[0].RepoTags[0]')
ctr -a /run/containerd-user/containerd.sock image tag "$import_tag" "$eve_external_boot_img"

logmsg "Successfully installed external-boot-image"
logmsg "Successfully installed external-boot-image $import_tag as $eve_external_boot_img"
rm -f /etc/external-boot-image.tar
fi
fi
Expand Down

0 comments on commit 7cd8640

Please sign in to comment.