-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz take a look at this PR #19344
and let me know if we merge that PR or this, are they gonna affect each other
|
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
Times 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
Times 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
Times 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
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
FIX #19233
What happened:
kicbase/echo-server:latest
without 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 ech2
You will find that the size of tarball is 0
func (r *Containerd) ImageExists(name string, sha string) bool
inpkg/minikube/cruntime/containerd.go
Original
ImageExists
usectr images check
to list all images, and then check whether the given image name appears in the stdout. However, the output for commandctr -n "k8s.io" image check
is 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 ech2
to 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) error
ofpkg/minikube/machine/cache_images.go
is 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 ech2
generates an empty tarballconst echoServerImg = "kicbase/echo-server"
After:
./out/minikube image save kicbase/echo-server:latest ech2
generates correct tarballconst echoServerImg = "kicbase/echo-server"