fix: fix empty tarball when generating image save#19312
Conversation
|
/ok-to-test |
This comment has been minimized.
This comment has been minimized.
|
Here are the number of top 10 failed tests in each environments with lowest flake rate.
Besides the following environments also have failed tests:
To see the flake rates of all tests by environment, click here. |
|
@ComradeProgrammer excellent ! thank you for such a detailed PR description, please check the docker Linux CRIO tests |
c58167e to
5c64880
Compare
This comment has been minimized.
This comment has been minimized.
|
Here are the number of top 10 failed tests in each environments with lowest flake rate.
Besides the following environments also have failed tests:
To see the flake rates of all tests by environment, click here. |
5c64880 to
83c70ad
Compare
|
This comment has been minimized.
This comment has been minimized.
|
Here are the number of top 10 failed tests in each environments with lowest flake rate.
Besides the following environments also have failed tests:
To see the flake rates of all tests by environment, click here. |
83c70ad to
759e2b6
Compare
|
kvm2 driver with docker runtime DetailsTimes for minikube start: 49.8s 48.7s 46.1s 48.6s 48.7s Times for minikube ingress: 23.9s 24.9s 23.9s 24.4s 23.9s docker driver with docker runtime DetailsTimes for minikube start: 20.1s 25.1s 21.3s 23.9s 21.3s Times for minikube ingress: 21.7s 21.7s 21.8s 22.7s 22.2s docker driver with containerd runtime DetailsTimes for minikube start: 22.4s 20.9s 22.9s 23.2s 20.8s Times for minikube ingress: 48.2s 40.2s 31.8s 48.2s 47.7s |
|
Here are the number of top 10 failed tests in each environments with lowest flake rate.
Besides the following environments also have failed tests:
To see the flake rates of all tests by environment, click here. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ComradeProgrammer, medyagh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
FIX #19233
What happened:
kicbase/echo-server:latestwithout prefixdocker.io, minikube will not fail. Instead, it will generate an empty tarball.You can use the following instructions to reproduce this bug:
./out/minikube image load kicbase/echo-server #load the image into minikube ./out/minikube image save kicbase/echo-server:latest ech2 du -h ech2You will find that the size of tarball is 0
func (r *Containerd) ImageExists(name string, sha string) boolinpkg/minikube/cruntime/containerd.goOriginal
ImageExistsusectr images checkto list all images, and then check whether the given image name appears in the stdout. However, the output for commandctr -n "k8s.io" image checkis something like thisThat means both
ImageExists("docker.io/kicbase/echo-server:latest")andImageExists("kicbase/echo-server:latest")will return true, even we expect the latter one to return a falseAccording to the official reply in github discussion of contained (Cannot check image by name using ctr. containerd/containerd#5334), The correct way to check the existence of the image is using
ctr -n "k8s.io" image list "name=xxxxxxxxxxxxxx". So I revised this function to do so.Now
ImageExists("kicbase/echo-server:latest")will return a false. However, we wantminikube image save kicbase/echo-server:latest ech2to success. So I reused existing logic to add docker.io prefix and retry if no registry is specified.After making the modification above, crio tests are still found to be broken. The reason is that when the image does not exist, and it does not start with "docker.io", crictl treats it as localhost and returns, crictl returns
so the logic in
func removeExistingImage(r cruntime.Manager, src string, imgName string) errorofpkg/minikube/machine/cache_images.gois incomplete, and it return nil even if the image does not exist Then the image (without docker.io prefix) is regarded as existing image, and the load process abort.Before&After:
Before:
./out/minikube image save kicbase/echo-server:latest ech2generates an empty tarballconst echoServerImg = "kicbase/echo-server"After:
./out/minikube image save kicbase/echo-server:latest ech2generates correct tarballconst echoServerImg = "kicbase/echo-server"